Skip to content

Commit ad36328

Browse files
committed
Remove bus caching
This was preventing multiple busses from being used
1 parent 2e45db0 commit ad36328

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

qwiic_i2c/__init__.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@
8484
except:
8585
pass
8686

87-
_theDriver = None
88-
8987
#-------------------------------------------------
9088
# Exported method to get the I2C driver for the execution plaform.
9189
#
@@ -107,21 +105,13 @@ def getI2CDriver(*args, **argk):
107105
>>> myData = i2cDriver.readByte(0x73, 0x34)
108106
"""
109107

110-
global _theDriver
111-
112-
if _theDriver != None:
113-
return _theDriver
114-
115-
116-
117108
for driverClass in _drivers:
118109

119110
# Does this class/driverd support this platform?
120111
if driverClass.isPlatform():
121112

122-
_theDriver = driverClass(*args, **argk)
123113
# Yes - return the driver object
124-
return _theDriver
114+
return driverClass(*args, **argk)
125115

126116
return None
127117

0 commit comments

Comments
 (0)