diff options
| author | Jean-François Milants <jf@codingfield.com> | 2021-04-08 20:07:24 +0200 |
|---|---|---|
| committer | Jean-François Milants <jf@codingfield.com> | 2021-04-08 20:07:24 +0200 |
| commit | 9ac4be8b759bb2cedeb999ce5e87d983261beded (patch) | |
| tree | 2a5fabd9b7505976c20b5512f9335e75290bdd86 /src/systemtask | |
| parent | 1d7576de64a33837434e6f414a74ae7dbe929196 (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')
| -rw-r--r-- | src/systemtask/SystemTask.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 4605ba95..6163c105 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, |
