From a4f41c1d299f934cf9328c639f3fb6d5b57d391e Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Mon, 17 Dec 2012 16:28:45 -0800 Subject: [PATCH] AP_InertialSensor: MPU6000 uses scheduler panic --- libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp index cb321bcbcc..068c637645 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp @@ -251,10 +251,9 @@ bool AP_InertialSensor_MPU6000::update( void ) uint32_t tstart = hal.scheduler->micros(); while (_count == 0) { if (hal.scheduler->micros() - tstart > 50000) { - hal.console->println_P( + hal.scheduler->panic( PSTR("PANIC: AP_InertialSensor_MPU6000::update " "waited 50ms for data from interrupt")); - return false; } } @@ -322,7 +321,7 @@ void AP_InertialSensor_MPU6000::read(uint32_t) if (!got) { semfail_ctr++; if (semfail_ctr > 100) { - hal.console->println_P(PSTR("PANIC: failed to take _spi_sem " + hal.scheduler->panic(PSTR("PANIC: failed to take _spi_sem " "100 times in AP_InertialSensor_MPU6000::read")); } return; @@ -356,7 +355,7 @@ void AP_InertialSensor_MPU6000::read(uint32_t) if (_spi_sem) { bool released = _spi_sem->release((void*)&_spi_sem); if (!released) { - hal.console->println_P(PSTR("PANIC: _spi_sem release failed in " + hal.scheduler->panic(PSTR("PANIC: _spi_sem release failed in " "AP_InertialSensor_MPU6000::read")); } }