MCPcopy
hub / github.com/PiLiDAR/PiLiDAR / get_platform

Function get_platform

lib/platform_utils.py:6–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def get_platform():
7 platform = sys.platform
8 # print("sys.platform:", platform)
9
10 if "win32" in platform:
11 platform = 'Windows'
12 elif 'darwin' in platform:
13 platform = 'Mac'
14 else:
15 machine = os.uname().machine
16 # print("os.uname():", os.uname())
17
18 if 'linux' in platform:
19 if 'aarch64' in machine:
20 platform = 'RaspberryPi'
21 else:
22 platform = 'Linux'
23 elif 'Pico W' in machine:
24 # 'Raspberry Pi Pico W with rp2040'
25 return 'Pico W'
26 elif 'Pico' in machine:
27 return 'Pico'
28 elif 'MIMXRT1011' in machine:
29 # 'Metro MIMXRT1011 with IMXRT1011DAE5A'
30 return 'Metro M7'
31 return platform
32
33
34platform = get_platform()

Callers 6

config.pyFile · 0.90
__init__Method · 0.90
opengl_fallbackFunction · 0.90
registration.pyFile · 0.90
platform_utils.pyFile · 0.85
allow_serialFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected