AP_HAL_PX4: 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 4b54bcbfad
commit f791767fb2

View File

@ -376,8 +376,13 @@ void *PX4Scheduler::_storage_thread(void)
void PX4Scheduler::panic(const prog_char_t *errormsg, ...) 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); write(1, "\n", 1);
hal.scheduler->delay_microseconds(10000); hal.scheduler->delay_microseconds(10000);
_px4_thread_should_exit = true; _px4_thread_should_exit = true;
exit(1); exit(1);