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.
This commit is contained in:
@@ -81,10 +81,11 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi,
|
||||
motionController{motionController},
|
||||
displayApp{displayApp},
|
||||
heartRateApp(heartRateApp) {
|
||||
systemTasksMsgQueue = xQueueCreate(10, 1);
|
||||
|
||||
}
|
||||
|
||||
void SystemTask::Start() {
|
||||
systemTasksMsgQueue = xQueueCreate(10, 1);
|
||||
if (pdPASS != xTaskCreate(SystemTask::Process, "MAIN", 350, this, 0, &taskHandle))
|
||||
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
|
||||
}
|
||||
|
Reference in New Issue
Block a user