Remove infinite blocking loop on I2C error
This commit is contained in:
parent
e9af3e542a
commit
a83e833d10
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user