InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.63k stars 901 forks source link

Fix MotorController::Init call order #2070

Closed pipe01 closed 3 weeks ago

pipe01 commented 3 weeks ago

The call to LoadNewScreen here (and the one below it) calls MotorController::StopRinging() here, which in turn calls xTimerStop to stop the ringing timer. However, this timer only gets created when DisplayApp::InitHw is called, which currently happens in DisplayApp::Process after the initial call to LoadNewScreen. This means that xTimerStop is called on uninitialized data, which has undefined behaviour.

This PR makes it so that the call to MotorController::Init happens before LoadNewScreen.

github-actions[bot] commented 3 weeks ago

Build checks have not completed. Possible reasons for this are:

  1. The checks need to be approved by a maintainer
  2. The branch has conflicts
  3. The firmware build has failed