summaryrefslogtreecommitdiff
path: root/src/systemtask/SystemTask.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-04-08 18:07:24 (GMT)
committerJean-François Milants <jf@codingfield.com>2021-04-08 18:07:24 (GMT)
commit9ac4be8b759bb2cedeb999ce5e87d983261beded (patch)
tree2a5fabd9b7505976c20b5512f9335e75290bdd86 /src/systemtask/SystemTask.cpp
parent1d7576de64a33837434e6f414a74ae7dbe929196 (diff)
TwiMaster is now based on the NRFX TWI driver, as it handles more edge cases and workarounds for errors on the bus.
Reset the TWI bus after the soft-reset of the motion sensor to workaround issues on the TWI bus.
Diffstat (limited to 'src/systemtask/SystemTask.cpp')
-rw-r--r--src/systemtask/SystemTask.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp
index 4605ba9..6163c10 100644
--- a/src/systemtask/SystemTask.cpp
+++ b/src/systemtask/SystemTask.cpp
@@ -84,10 +84,14 @@ void SystemTask::Work() {
touchPanel.Init();
batteryController.Init();
motorController.Init();
- motionSensor.Init();
+ motionSensor.SoftReset();
- settingsController.Init();
+ // Reset the TWI device because the motion sensor chip most probably crashed it...
+ twiMaster.Sleep();
+ twiMaster.Init();
+ motionSensor.Init();
+ settingsController.Init();
displayApp = std::make_unique<Pinetime::Applications::DisplayApp>(lcd, lvgl, touchPanel, batteryController, bleController,
dateTimeController, watchdogView, *this, notificationManager,