Skip to content

Commit d2d57d6

Browse files
committed
Bugfix Channel Scan
This Commit, - Fixes Bug with Channel scan
1 parent e79e116 commit d2d57d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adafruit_tca9548a.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ def writeto_then_readfrom(self, address, buffer_out, buffer_in, **kwargs):
7777

7878
def scan(self):
7979
"""Perform an I2C Device Scan"""
80-
return self.tca.i2c.scan()
80+
addresses = []
81+
if self.try_lock():
82+
addresses = self.tca.i2c.scan()
83+
self.unlock()
84+
85+
return addresses
8186

8287

8388
class TCA9548A:

0 commit comments

Comments
 (0)