diff --git a/libraries/AP_HAL_PX4/Scheduler.cpp b/libraries/AP_HAL_PX4/Scheduler.cpp index ec7041e473..c69d1321dd 100644 --- a/libraries/AP_HAL_PX4/Scheduler.cpp +++ b/libraries/AP_HAL_PX4/Scheduler.cpp @@ -376,8 +376,13 @@ void *PX4Scheduler::_storage_thread(void) void PX4Scheduler::panic(const prog_char_t *errormsg, ...) { - write(1, errormsg, strlen(errormsg)); + va_list ap; + + va_start(ap, errormsg); + vdprintf(1, errormsg, ap); + va_end(ap); write(1, "\n", 1); + hal.scheduler->delay_microseconds(10000); _px4_thread_should_exit = true; exit(1);