adafruit / Adafruit_CircuitPython_TCA9548A

CircuitPython driver for the TCA9548A I2C Multiplexer.
MIT License
26 stars 15 forks source link

CPU to 100% when unable to lock #52

Open ilario opened 3 months ago

ilario commented 3 months ago

The initial code had a loop inside the TCA9548A_Channel.try_lock() function that was then modified by #39 to be as it appears today:

https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A/blob/893d14d0184425efd387d30e602b0be025274b8d/adafruit_tca9548a.py#L58-L63

I am using an A64-OLinuXino with a battery pack for controlling the multiplexers. When there is a power cut, the CPU goes to 100% due to this loop and the battery pack does not last much.

Would it be ok to increase the sleeping time from zero to something else, or even to make it customizable?