|
|
|
@ -223,7 +223,12 @@ static void sitl_simulator_output(void)
@@ -223,7 +223,12 @@ static void sitl_simulator_output(void)
|
|
|
|
|
static void timer_handler(int signum) |
|
|
|
|
{ |
|
|
|
|
static uint32_t last_update_count; |
|
|
|
|
static bool running; |
|
|
|
|
|
|
|
|
|
if (running) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
running = true; |
|
|
|
|
cli(); |
|
|
|
|
|
|
|
|
|
#ifndef __CYGWIN__ |
|
|
|
@ -261,11 +266,13 @@ static void timer_handler(int signum)
@@ -261,11 +266,13 @@ static void timer_handler(int signum)
|
|
|
|
|
if (update_count == 0) { |
|
|
|
|
sitl_update_gps(0, 0, 0, 0, 0, false); |
|
|
|
|
sei(); |
|
|
|
|
running = false; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (update_count == last_update_count) { |
|
|
|
|
sei(); |
|
|
|
|
running = false; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
last_update_count = update_count; |
|
|
|
@ -280,6 +287,7 @@ static void timer_handler(int signum)
@@ -280,6 +287,7 @@ static void timer_handler(int signum)
|
|
|
|
|
sitl_update_barometer(sim_state.altitude); |
|
|
|
|
sitl_update_compass(sim_state.rollDeg, sim_state.pitchDeg, sim_state.heading); |
|
|
|
|
sei(); |
|
|
|
|
running = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|