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.
This commit is contained in:
Lucas De Marchi 2015-11-10 15:58:59 -02:00 committed by Andrew Tridgell
parent ca31ced2b4
commit 1d51e60571

View File

@ -16,6 +16,12 @@
using namespace Linux; 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 // 3 serial ports on Linux for now
static UARTDriver uartADriver(true); static UARTDriver uartADriver(true);
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO
@ -140,11 +146,6 @@ static Empty::EmptyRCOutput rcoutDriver;
#endif #endif
static Scheduler schedulerInstance; 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() : HAL_Linux::HAL_Linux() :
AP_HAL::HAL( AP_HAL::HAL(