From 2735df29ed416c518515a4cf15560048a629c0bc Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Sun, 18 Sep 2016 17:37:58 +0100 Subject: [PATCH] Prevent incorrect rescheduling for BMP280 baro dummy ut_delay (#612) (cherry picked from commit 79fdc6d3922ed75ca5732436c6517db279558f4c) --- src/main/fc/mw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/fc/mw.c b/src/main/fc/mw.c index 87aee6acb..ab7ed7a58 100755 --- a/src/main/fc/mw.c +++ b/src/main/fc/mw.c @@ -726,8 +726,10 @@ void taskUpdateCompass(void) void taskUpdateBaro(void) { if (sensors(SENSOR_BARO)) { - uint32_t newDeadline = baroUpdate(); - rescheduleTask(TASK_SELF, newDeadline); + const uint32_t newDeadline = baroUpdate(); + if (newDeadline != 0) { + rescheduleTask(TASK_SELF, newDeadline); + } } //updatePositionEstimator_BaroTopic(currentTime);