From a545c94b2c6f70f7c1545b57bf3a0c0bb4244ceb Mon Sep 17 00:00:00 2001 From: "mich146@hotmail.com" Date: Tue, 23 Aug 2011 05:52:45 +0000 Subject: [PATCH] Level fix. git-svn-id: https://arducopter.googlecode.com/svn/trunk@3155 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- ArduCopterMega/GCS_Mavlink.pde | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ArduCopterMega/GCS_Mavlink.pde b/ArduCopterMega/GCS_Mavlink.pde index a421252308..b973d80889 100644 --- a/ArduCopterMega/GCS_Mavlink.pde +++ b/ArduCopterMega/GCS_Mavlink.pde @@ -1148,6 +1148,14 @@ static void mavlink_delay(unsigned long t) { unsigned long tstart; static unsigned long last_1hz, last_3hz, last_10hz, last_50hz; + static bool recursing; + + if (recursing) { + delay(t); + return; + } + + recursing = true; tstart = millis(); do { @@ -1178,4 +1186,6 @@ static void mavlink_delay(unsigned long t) } delay(1); } while (millis() - tstart < t); -} + + recursing = false; +}