The call to LoadNewScreenhere (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.
The call to
LoadNewScreen
here (and the one below it) callsMotorController::StopRinging()
here, which in turn callsxTimerStop
to stop the ringing timer. However, this timer only gets created whenDisplayApp::InitHw
is called, which currently happens inDisplayApp::Process
after the initial call toLoadNewScreen
. This means thatxTimerStop
is called on uninitialized data, which has undefined behaviour.This PR makes it so that the call to
MotorController::Init
happens beforeLoadNewScreen
.