AP_Logger: examples: add test for Write and WriteCritical

This commit is contained in:
Peter Barker 2019-05-15 15:45:32 +10:00 committed by Andrew Tridgell
parent 54eff7eafc
commit 0225b6817a
1 changed files with 19 additions and 1 deletions

View File

@ -88,11 +88,29 @@ void AP_LoggerTest::setup(void)
hal.console->printf("Average write time %.1f usec/byte\n",
(double)total_micros/((double)i*sizeof(struct log_Test)));
uint64_t now = AP_HAL::micros64();
hal.console->printf("Testing Write\n");
logger.Write("MARY",
"TimeUS,GoodValue",
"sm",
"F0",
"Qf",
now,
-1.5673);
hal.console->printf("Testing WriteCritical\n");
logger.WriteCritical("BOB",
"TimeUS,GreatValue",
"sm",
"F0",
"Qf",
now,
17.3);
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX
logger.flush();
#endif
hal.scheduler->delay(100);
logger.set_vehicle_armed(false);
}
void AP_LoggerTest::loop(void)