From fc66f5594f2d8d29d81aad79fa8fe9ca55b16fa3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 18 Dec 2012 21:27:50 +1100 Subject: [PATCH] AHRS: allow AHRS test to build with SITL --- libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.pde | 13 +++++++++---- libraries/AP_AHRS/examples/AHRS_Test/Makefile | 3 --- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.pde b/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.pde index 3654a0ad54..0b84ee04ad 100644 --- a/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.pde +++ b/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.pde @@ -19,24 +19,29 @@ #include #include #include +#include #include #include +#include +#include + +const AP_HAL::HAL& hal = AP_HAL_BOARD_DRIVER; #if CONFIG_HAL_BOARD == HAL_BOARD_APM2 -const AP_HAL::HAL& hal = AP_HAL_AVR_APM2; AP_InertialSensor_MPU6000 ins; #elif CONFIG_HAL_BOARD == HAL_BOARD_APM1 AP_ADC_ADS7844 adc; AP_InertialSensor_Oilpan ins( &adc ); -const AP_HAL::HAL& hal = AP_HAL_AVR_APM1; +#else +AP_InertialSensor_Stub ins; #endif AP_Compass_HMC5843 compass; GPS *g_gps; -AP_GPS_Auto g_gps_driver(hal.uartB, &g_gps); +AP_GPS_Auto g_gps_driver(&g_gps); // choose which AHRS system to use AP_AHRS_DCM ahrs(&ins, g_gps); @@ -94,7 +99,7 @@ void setup(void) } g_gps = &g_gps_driver; #if WITH_GPS - g_gps->init(); + g_gps->init(hal.uartB); #endif } diff --git a/libraries/AP_AHRS/examples/AHRS_Test/Makefile b/libraries/AP_AHRS/examples/AHRS_Test/Makefile index fcdc8ff8fe..d1f40fd90f 100644 --- a/libraries/AP_AHRS/examples/AHRS_Test/Makefile +++ b/libraries/AP_AHRS/examples/AHRS_Test/Makefile @@ -1,4 +1 @@ include ../../../AP_Common/Arduino.mk - -sitl: - make -f ../../../../libraries/Desktop/Desktop.mk