Fix wake up lock in twi
optimize battery code
This commit is contained in:
parent
96961709f3
commit
365e68e6cc
5 changed files with 52 additions and 46 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue