Remove infinite blocking loop on I2C error

This commit is contained in:
xs5871
2023-02-12 12:48:16 +00:00
parent e9af3e542a
commit a83e833d10

View File

@@ -274,8 +274,8 @@ class Trackball(Module):
def _i2c_rdwr(self, data, length=0):
'''Write and optionally read I2C data.'''
while not self._i2c_bus.try_lock():
pass
if not self._i2c_bus.try_lock():
return
try:
if length > 0: