From 42255ebbc6e977bd5a529ffbd1338cfd72998fcb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 8 Oct 2013 11:26:04 +1100 Subject: [PATCH] Rover: improved loop() latency --- APMrover2/APMrover2.pde | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/APMrover2/APMrover2.pde b/APMrover2/APMrover2.pde index 715d7c625a..e494490459 100644 --- a/APMrover2/APMrover2.pde +++ b/APMrover2/APMrover2.pde @@ -623,10 +623,8 @@ void loop() fast_loopTimeStamp = millis(); scheduler.run(19000U); - } - if ((timer - fast_loopTimer) <= 19) { - // we have plenty of time - be friendly to multi-tasking OSes - hal.scheduler->delay(1); + } else { + hal.scheduler->delay_microseconds(500); } }