We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 346e8d3 commit c0abb19Copy full SHA for c0abb19
adafruit_pybadger/pybadge.py
@@ -64,10 +64,14 @@ def __init__(self):
64
self._accelerometer = None
65
66
if i2c is not None:
67
- while not i2c.try_lock():
68
- pass
69
- _i2c_devices = i2c.scan()
70
- i2c.unlock()
+ _i2c_devices = []
+
+ for i in range(10):
+ # try lock 10 times to avoid infinite loop in sphinx build
71
+ if i2c.try_lock():
72
+ _i2c_devices = i2c.scan()
73
+ i2c.unlock()
74
+ break
75
76
# PyBadge LC doesn't have accelerometer
77
if int(0x18) in _i2c_devices or int(0x19) in _i2c_devices:
0 commit comments