From ab6201ff86861141efa0a38fb5b0aea092b7fd94 Mon Sep 17 00:00:00 2001 From: Ilario Gelmetti Date: Wed, 7 Aug 2024 11:41:21 +0200 Subject: [PATCH] try_lock increase wait time from 0 to 1 ms --- adafruit_tca9548a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_tca9548a.py b/adafruit_tca9548a.py index c766176..4e21d8a 100644 --- a/adafruit_tca9548a.py +++ b/adafruit_tca9548a.py @@ -58,7 +58,7 @@ def __init__(self, tca: "TCA9548A", channel: int) -> None: def try_lock(self) -> bool: """Pass through for try_lock.""" while not self.tca.i2c.try_lock(): - time.sleep(0) + time.sleep(0.001) self.tca.i2c.writeto(self.tca.address, self.channel_switch) return True