AP_HAL_FLYMAPLE: Scheduler: implement variadic version of panic()

This commit is contained in:
Lucas De Marchi 2015-10-22 15:15:05 -02:00 committed by Andrew Tridgell
parent e2d1fab863
commit 3650eb468f
1 changed files with 10 additions and 1 deletions

View File

@ -15,6 +15,8 @@
#include "Scheduler.h" #include "Scheduler.h"
#include <stdarg.h>
#define millis libmaple_millis #define millis libmaple_millis
#define micros libmaple_micros #define micros libmaple_micros
#include "FlymapleWirish.h" #include "FlymapleWirish.h"
@ -232,8 +234,15 @@ void FLYMAPLEScheduler::panic(const prog_char_t *errormsg, ...) {
/* Suspend timer processes. We still want the timer event to go off /* Suspend timer processes. We still want the timer event to go off
* to run the _failsafe code, however. */ * to run the _failsafe code, however. */
// REVISIT: not tested on FLYMAPLE // REVISIT: not tested on FLYMAPLE
va_list ap;
_timer_suspended = true; _timer_suspended = true;
hal.console->println_P(errormsg);
va_start(ap, errormsg);
hal.console->vprintf_P(errormsg, ap);
va_end(ap);
hal.console->printf_P("\n");
for(;;); for(;;);
} }