Browse Source

AP_HAL_FLYMAPLE: Scheduler: implement variadic version of panic()

master
Lucas De Marchi 9 years ago committed by Andrew Tridgell
parent
commit
3650eb468f
  1. 11
      libraries/AP_HAL_FLYMAPLE/Scheduler.cpp

11
libraries/AP_HAL_FLYMAPLE/Scheduler.cpp

@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
#include "Scheduler.h"
#include <stdarg.h>
#define millis libmaple_millis
#define micros libmaple_micros
#include "FlymapleWirish.h"
@ -232,8 +234,15 @@ void FLYMAPLEScheduler::panic(const prog_char_t *errormsg, ...) { @@ -232,8 +234,15 @@ void FLYMAPLEScheduler::panic(const prog_char_t *errormsg, ...) {
/* Suspend timer processes. We still want the timer event to go off
* to run the _failsafe code, however. */
// REVISIT: not tested on FLYMAPLE
va_list ap;
_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(;;);
}

Loading…
Cancel
Save