From a2f1bf581a1bee089d880901830604168011ca83 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 3 Aug 2015 15:58:57 +1000 Subject: [PATCH] DataFlash: fix test for SITL and linux --- .../examples/DataFlash_test/DataFlash_test.cpp | 11 ++++++++--- libraries/DataFlash/examples/DataFlash_test/make.inc | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libraries/DataFlash/examples/DataFlash_test/DataFlash_test.cpp b/libraries/DataFlash/examples/DataFlash_test/DataFlash_test.cpp index 686edd7440..165c21ba53 100644 --- a/libraries/DataFlash/examples/DataFlash_test/DataFlash_test.cpp +++ b/libraries/DataFlash/examples/DataFlash_test/DataFlash_test.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -107,8 +108,8 @@ void DataFlashTest::setup(void) v2 : (uint16_t)(2001 + i), v3 : (uint16_t)(2002 + i), v4 : (uint16_t)(2003 + i), - l1 : (long)i * 5000, - l2 : (long)i * 16268 + l1 : (int32_t)(i * 5000), + l2 : (int32_t)(i * 16268) }; dataflash.WriteBlock(&pkt, sizeof(pkt)); total_micros += hal.scheduler->micros() - start; @@ -116,7 +117,11 @@ void DataFlashTest::setup(void) } hal.console->printf("Average write time %.1f usec/byte\n", - (double)total_micros/((float)i*sizeof(struct log_Test))); + (double)total_micros/((double)i*sizeof(struct log_Test))); + +#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX + dataflash.flush(); +#endif hal.scheduler->delay(100); } diff --git a/libraries/DataFlash/examples/DataFlash_test/make.inc b/libraries/DataFlash/examples/DataFlash_test/make.inc index df415552ce..158ad8a388 100644 --- a/libraries/DataFlash/examples/DataFlash_test/make.inc +++ b/libraries/DataFlash/examples/DataFlash_test/make.inc @@ -11,6 +11,7 @@ LIBRARIES += AP_GPS LIBRARIES += AP_HAL LIBRARIES += AP_HAL_AVR LIBRARIES += AP_HAL_Empty +LIBRARIES += AP_HAL_Linux LIBRARIES += AP_HAL_PX4 LIBRARIES += AP_HAL_SITL LIBRARIES += AP_InertialSensor @@ -18,6 +19,7 @@ LIBRARIES += AP_Math LIBRARIES += AP_Mission LIBRARIES += AP_NavEKF LIBRARIES += AP_Notify +LIBRARIES += AP_OpticalFlow LIBRARIES += AP_Param LIBRARIES += AP_Progmem LIBRARIES += AP_Rally @@ -28,4 +30,5 @@ LIBRARIES += AP_Vehicle LIBRARIES += DataFlash LIBRARIES += Filter LIBRARIES += GCS_MAVLink +LIBRARIES += SITL LIBRARIES += StorageManager