File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2525 0x4 : "Latch Relay"
2626}
2727
28+ _BOOTLOADER_ADDRESS = const (0x64 )
29+
2830class _I2CHelper :
2931 """
3032 A helper class for interacting with I2C devices on supported boards.
@@ -267,7 +269,7 @@ def enter_bootloader(self):
267269 sleep (0.25 ) # Wait for the device to reset
268270 return True
269271 except OSError as e :
270- # ENODEV (e.errno == 19) can be thrown if either the device reset while writing out the buffer
272+ # ENODEV (e.errno == 19) can be thrown if the device resets while writing out the buffer
271273 return False
272274
273275 def read (self , amount_of_bytes : int ) -> bytes | None :
@@ -328,6 +330,9 @@ def available_devices(bus: I2C = None) -> list[Modulino]:
328330 device_addresses = bus .scan ()
329331 devices = []
330332 for address in device_addresses :
333+ if address == _BOOTLOADER_ADDRESS :
334+ # Skip bootloader address
335+ continue
331336 device = Modulino (i2c_bus = bus , address = address )
332337 devices .append (device )
333338 return devices
You can’t perform that action at this time.
0 commit comments