MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / _ifMutexAcquire

Function _ifMutexAcquire

Software/Python/easysensors.py:21–28  ·  view source on GitHub ↗

Acquires the I2C if the ``use_mutex`` parameter of the constructor was set to ``True``. Always acquires if system-wide mutex has been set.

(mutex_enabled=False)

Source from the content-addressed store, hash-verified

19
20
21def _ifMutexAcquire(mutex_enabled=False):
22 """
23 Acquires the I2C if the ``use_mutex`` parameter of the constructor was set to ``True``.
24 Always acquires if system-wide mutex has been set.
25
26 """
27 if mutex_enabled or mutex.overall_mutex()==True:
28 mutex.acquire()
29
30def _ifMutexRelease(mutex_enabled=False):
31 """

Callers 4

readMethod · 0.85
read_temperatureMethod · 0.85
read_humidityMethod · 0.85
readMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected