|
|
|
@ -16,14 +16,15 @@
@@ -16,14 +16,15 @@
|
|
|
|
|
*/ |
|
|
|
|
void Plane::failsafe_check(void) |
|
|
|
|
{ |
|
|
|
|
static uint16_t last_mainLoop_count; |
|
|
|
|
static uint16_t last_ticks; |
|
|
|
|
static uint32_t last_timestamp; |
|
|
|
|
static bool in_failsafe; |
|
|
|
|
uint32_t tnow = micros(); |
|
|
|
|
|
|
|
|
|
if (perf_info.get_num_loops() != last_mainLoop_count) { |
|
|
|
|
const uint16_t ticks = scheduler.ticks(); |
|
|
|
|
if (ticks != last_ticks) { |
|
|
|
|
// the main loop is running, all is OK
|
|
|
|
|
last_mainLoop_count = perf_info.get_num_loops(); |
|
|
|
|
last_ticks = ticks; |
|
|
|
|
last_timestamp = tnow; |
|
|
|
|
in_failsafe = false; |
|
|
|
|
return; |
|
|
|
|