diff options
| author | Jean-François Milants <jf@codingfield.com> | 2021-06-12 08:58:28 (GMT) |
|---|---|---|
| committer | Jean-François Milants <jf@codingfield.com> | 2021-06-12 08:58:28 (GMT) |
| commit | 6d524ebea2c97e309633d5e01c3a1e37c182f27d (patch) | |
| tree | 3f9c7f96f0fab64f581035c72480596a4cc4db43 /src/displayapp/DisplayAppRecovery.cpp | |
| parent | b1925ff28638dd4b8400c4d0c49d796d8990b1af (diff) | |
Move most of the code from the constructor of the objects statically initialized in main() into Start()/Init() functions to avoid Static Initialization Order Fiasco (https://en.cppreference.com/w/cpp/language/siof). See https://github.com/JF002/InfiniTime/pull/415#issuecomment-859004238.
Diffstat (limited to 'src/displayapp/DisplayAppRecovery.cpp')
| -rw-r--r-- | src/displayapp/DisplayAppRecovery.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp index b73d0a8..fd517b1 100644 --- a/src/displayapp/DisplayAppRecovery.cpp +++ b/src/displayapp/DisplayAppRecovery.cpp @@ -21,10 +21,11 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController) : lcd {lcd}, bleController {bleController} { - msgQueue = xQueueCreate(queueSize, itemSize); + } void DisplayApp::Start() { + msgQueue = xQueueCreate(queueSize, itemSize); if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 512, this, 0, &taskHandle)) APP_ERROR_HANDLER(NRF_ERROR_NO_MEM); } |
