summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorJoaquim <joaquim.org@gmail.com>2021-04-04 12:51:22 (GMT)
committerJoaquim <joaquim.org@gmail.com>2021-04-04 12:51:22 (GMT)
commitbb7531e2085cee056161c528d84884d5a75c5e6e (patch)
tree3b2df5a3d0f06ccf2d517597af5efb6153f4d4d0 /src/drivers
parent1d3742e14f09316a1d795527713eb8f9742f0ffb (diff)
double tap wakeup error fix
battery nonblocking read
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/TwiMaster.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/drivers/TwiMaster.cpp b/src/drivers/TwiMaster.cpp
index 6a063ec..d5898b5 100644
--- a/src/drivers/TwiMaster.cpp
+++ b/src/drivers/TwiMaster.cpp
@@ -10,6 +10,7 @@ using namespace Pinetime::Drivers;
TwiMaster::TwiMaster(const Modules module, const Parameters& params) : module{module}, params{params} {
mutex = xSemaphoreCreateBinary();
+ ASSERT(mutex != NULL);
}
void TwiMaster::Init() {
@@ -61,9 +62,11 @@ void TwiMaster::Init() {
}
TwiMaster::ErrorCodes TwiMaster::Read(uint8_t deviceAddress, uint8_t registerAddress, uint8_t *data, size_t size) {
- xSemaphoreTake(mutex, portMAX_DELAY);
+ // this is causing an error when came from sleep
+ //xSemaphoreTake(mutex, portMAX_DELAY);
+
auto ret = ReadWithRetry(deviceAddress, registerAddress, data, size);
- xSemaphoreGive(mutex);
+ //xSemaphoreGive(mutex);
return ret;
}