Fix wake up lock in twi

optimize battery code
This commit is contained in:
Joaquim
2021-04-05 15:22:10 +01:00
parent 96961709f3
commit 365e68e6cc
5 changed files with 52 additions and 46 deletions

View File

@@ -62,11 +62,9 @@ void TwiMaster::Init() {
}
TwiMaster::ErrorCodes TwiMaster::Read(uint8_t deviceAddress, uint8_t registerAddress, uint8_t *data, size_t size) {
// this is causing an error when came from sleep
//
//xSemaphoreTake(mutex, portMAX_DELAY);
xSemaphoreTake(mutex, portMAX_DELAY);
auto ret = ReadWithRetry(deviceAddress, registerAddress, data, size);
//xSemaphoreGive(mutex);
xSemaphoreGive(mutex);
return ret;
}