This PR implements the locking and unlocking of the I2C bus mutex to allow for the eventual implementation of multi-threading.
Certain functions in the sensor drivers that use the I2C bus do not lock it, simply because they are functions that are meant to be called in sequence or multiple times (i.e. multiple calls to read byte for extracting data). These functions are marked with WARNING in their docstrings so that callers are aware that they must lock the I2C bus before performing a collection of these calls. This reduces overhead.
This PR implements the locking and unlocking of the I2C bus mutex to allow for the eventual implementation of multi-threading.
Certain functions in the sensor drivers that use the I2C bus do not lock it, simply because they are functions that are meant to be called in sequence or multiple times (i.e. multiple calls to read byte for extracting data). These functions are marked with
WARNING
in their docstrings so that callers are aware that they must lock the I2C bus before performing a collection of these calls. This reduces overhead.