From 1d51e6057163a540011e95a6b2beb0077b22cf2d Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 10 Nov 2015 15:58:59 -0200 Subject: [PATCH] AP_HAL_Linux: move Util instantiation The util object may be used by all other objects so we need to instantiate it as earlier as possible. --- libraries/AP_HAL_Linux/HAL_Linux_Class.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp b/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp index 57880c7289..4939d6230a 100644 --- a/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp +++ b/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp @@ -16,6 +16,12 @@ using namespace Linux; +#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_RASPILOT || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ERLEBRAIN2 +static UtilRPI utilInstance; +#else +static Util utilInstance; +#endif + // 3 serial ports on Linux for now static UARTDriver uartADriver(true); #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO @@ -140,11 +146,6 @@ static Empty::EmptyRCOutput rcoutDriver; #endif static Scheduler schedulerInstance; -#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_RASPILOT || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ERLEBRAIN2 -static UtilRPI utilInstance; -#else -static Util utilInstance; -#endif HAL_Linux::HAL_Linux() : AP_HAL::HAL(