File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1212from .devices import lpc
1313if os .name == "posix" :
1414 from .devices import dev
15+ else :
16+ dev = None
1517
1618
1719class DeviceTypes (Enum ):
@@ -34,9 +36,12 @@ def pick_device() -> DeviceTypes:
3436 * `DeviceTypes.LinuxDev` (see `cros_ec_python.devices.dev.CrosEcDev.detect()`)
3537 * `DeviceTypes.LPC` (see `cros_ec_python.devices.lpc.CrosEcLpc.detect()`)
3638 """
37- if dev .CrosEcDev .detect ():
39+ if os .name == "nt" :
40+ # detect only works on Linux for now
41+ return DeviceTypes .LPC
42+ elif dev and dev .CrosEcDev .detect ():
3843 return DeviceTypes .LinuxDev
39- elif lpc .CrosEcLpc .detect ():
44+ elif lpc and lpc .CrosEcLpc .detect ():
4045 return DeviceTypes .LPC
4146 else :
4247 raise OSError ("Could not auto detect device, check you have the required permissions, or specify manually." )
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ def detect() -> bool:
4242 """
4343 Checks for known CrOS EC memory map addresses in `/proc/ioports`.
4444 """
45+ # TODO: Windows support (Get-CimInstance -Class Win32_PortResource)
4546 with open ("/proc/ioports" , "r" ) as f :
4647 for line in f :
4748 if line .lstrip ()[:4 ] in (
You can’t perform that action at this time.
0 commit comments