From d844a1ba3c993509bb46a62fe3bc9a2356f145c4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 13 Jan 2013 21:10:53 +1100 Subject: [PATCH] AP_InertialSensor: fixed PX4 example build --- libraries/AP_InertialSensor/examples/PX4/PX4.pde | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/AP_InertialSensor/examples/PX4/PX4.pde b/libraries/AP_InertialSensor/examples/PX4/PX4.pde index 2db235c4d1..ced31891c7 100644 --- a/libraries/AP_InertialSensor/examples/PX4/PX4.pde +++ b/libraries/AP_InertialSensor/examples/PX4/PX4.pde @@ -18,6 +18,9 @@ #include const AP_HAL::HAL& hal = AP_HAL_BOARD_DRIVER; + +#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 + AP_InertialSensor_PX4 ins; void setup(void) @@ -180,7 +183,7 @@ void run_test() // display results hal.console->printf_P(PSTR("Accel X:%4.2f \t Y:%4.2f \t Z:%4.2f \t len:%4.2f \t Gyro X:%4.2f \t Y:%4.2f \t Z:%4.2f \t Temp:%4.2f dt:%u\n"), accel.x, accel.y, accel.z, length, gyro.x, gyro.y, gyro.z, temperature, - ins.get_delta_time_micros()); + (unsigned)(1.0e6*ins.get_delta_time())); } } @@ -190,4 +193,9 @@ void run_test() } } +#else +void setup() {} +void loop() {} +#endif // CONFIG_HAL_BOARD + AP_HAL_MAIN();