Skip to content

Commit cb49a1d

Browse files
authored
Fix/overallmutexcheck (#292)
* read_position_str() is also needed here to keep in sync with easygopigo3 * Query overallmutex flag every single time
1 parent 1935f2f commit cb49a1d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Software/Python/easygopigo.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,21 @@
1919
from I2C_mutex import Mutex
2020

2121
mutex = Mutex()
22-
overall_mutex = mutex.overall_mutex()
2322

2423
def _ifMutexAcquire(mutex_enabled = False):
2524
"""
2625
Acquires the I2C if the ``use_mutex`` parameter of the constructor was set to ``True``.
2726
Always acquires if system-wide mutex has been set.
2827
2928
"""
30-
if mutex_enabled or overall_mutex==True:
29+
if mutex_enabled or mutex.overall_mutex()==True:
3130
mutex.acquire()
3231

3332
def _ifMutexRelease(mutex_enabled = False):
3433
"""
3534
Releases the I2C if the ``use_mutex`` parameter of the constructor was set to ``True``.
3635
"""
37-
if mutex_enabled or overall_mutex==True:
36+
if mutex_enabled or mutex.overall_mutex()==True:
3837
mutex.release()
3938

4039
try:

0 commit comments

Comments
 (0)