From 5e3e7cc4e3e4ba4559686abeb783195ce4e062ab Mon Sep 17 00:00:00 2001 From: Mathieu Rondonneau Date: Sat, 18 Jun 2011 17:28:37 -0700 Subject: [PATCH] OP-423 Fix issue with init not properly started in the right order endup up object thinking other where not init. --- flight/CopterControl/System/coptercontrol.c | 6 +++++- flight/Modules/System/systemmod.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/flight/CopterControl/System/coptercontrol.c b/flight/CopterControl/System/coptercontrol.c index bfba951b9..29dc68bae 100644 --- a/flight/CopterControl/System/coptercontrol.c +++ b/flight/CopterControl/System/coptercontrol.c @@ -90,6 +90,10 @@ int main() */ initcall_t *fn; int32_t ret; + + /* this one needs to be done first */ + SystemModInitialize(); + for (fn = __module_initcall_start; fn < __module_initcall_end; fn++) ret = (*fn)(); @@ -102,7 +106,7 @@ int main() vTaskStartScheduler(); #endif - return 0; + return 0; } /** diff --git a/flight/Modules/System/systemmod.c b/flight/Modules/System/systemmod.c index 9bb6653cb..fabacd0b1 100644 --- a/flight/Modules/System/systemmod.c +++ b/flight/Modules/System/systemmod.c @@ -87,7 +87,6 @@ static void systemTask(void *parameters); * Initialise the module, called on startup. * \returns 0 on success or -1 if initialisation failed */ -module_initcall(SystemModInitialize, 0); int32_t SystemModInitialize(void) { // Initialize vars