summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorJoaquim <joaquim.org@gmail.com>2021-04-05 14:22:10 (GMT)
committerJoaquim <joaquim.org@gmail.com>2021-04-05 14:22:10 (GMT)
commit365e68e6cc3c9f893e7582d26a1805d6d51ef294 (patch)
tree9eff0e7f277419d4b551413be2d498602fcbcbe2 /src/drivers
parent96961709f3a659fd89ccbb8a13813ed9f3c586eb (diff)
Fix wake up lock in twi
optimize battery code
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/TwiMaster.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/drivers/TwiMaster.cpp b/src/drivers/TwiMaster.cpp
index 072dd5f..021eac5 100644
--- a/src/drivers/TwiMaster.cpp
+++ b/src/drivers/TwiMaster.cpp
@@ -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;
}