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/DisplayApp.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/DisplayApp.cpp')
| -rw-r--r-- | src/displayapp/DisplayApp.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 3bfaf2a..05f171b 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -77,12 +77,14 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, motorController {motorController}, motionController {motionController}, timerController {timerController} { +} + +void DisplayApp::Start() { msgQueue = xQueueCreate(queueSize, itemSize); + // Start clock when smartwatch boots LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::None); -} -void DisplayApp::Start() { if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 800, this, 0, &taskHandle)) { APP_ERROR_HANDLER(NRF_ERROR_NO_MEM); } |
