From 6a933478d27f93e29cae62631df0c87b6eb02a27 Mon Sep 17 00:00:00 2001 From: Steve Evans Date: Sat, 15 Jan 2022 21:32:54 +0000 Subject: [PATCH] Fix BARO task rate display --- src/main/sensors/barometer.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/sensors/barometer.c b/src/main/sensors/barometer.c index dbbb825f4..d1114f14e 100644 --- a/src/main/sensors/barometer.c +++ b/src/main/sensors/barometer.c @@ -388,11 +388,6 @@ uint32_t baroUpdate(timeUs_t currentTimeUs) DEBUG_SET(DEBUG_BARO, 0, state); - // Where we are using a state machine call schedulerIgnoreTaskExecRate() for all states bar one - if (state != BARO_STATE_TEMPERATURE_START) { - schedulerIgnoreTaskExecRate(); - } - if (busBusy(&baro.dev.dev, NULL)) { // If the bus is busy, simply return to have another go later schedulerIgnoreTaskStateTime(); @@ -412,7 +407,7 @@ uint32_t baroUpdate(timeUs_t currentTimeUs) state = BARO_STATE_TEMPERATURE_SAMPLE; } else { // No action was taken as the read has not completed - schedulerIgnoreTaskStateTime(); + schedulerIgnoreTaskExecTime(); } break; @@ -421,7 +416,7 @@ uint32_t baroUpdate(timeUs_t currentTimeUs) state = BARO_STATE_PRESSURE_START; } else { // No action was taken as the read has not completed - schedulerIgnoreTaskStateTime(); + schedulerIgnoreTaskExecTime(); } break; @@ -436,14 +431,14 @@ uint32_t baroUpdate(timeUs_t currentTimeUs) state = BARO_STATE_PRESSURE_SAMPLE; } else { // No action was taken as the read has not completed - schedulerIgnoreTaskStateTime(); + schedulerIgnoreTaskExecTime(); } break; case BARO_STATE_PRESSURE_SAMPLE: if (!baro.dev.get_up(&baro.dev)) { // No action was taken as the read has not completed - schedulerIgnoreTaskStateTime(); + schedulerIgnoreTaskExecTime(); break; } @@ -465,6 +460,11 @@ uint32_t baroUpdate(timeUs_t currentTimeUs) break; } + // Where we are using a state machine call schedulerIgnoreTaskExecRate() for all states bar one + if (sleepTime != baro.dev.ut_delay) { + schedulerIgnoreTaskExecRate(); + } + executeTimeUs = micros() - currentTimeUs; if (executeTimeUs > baroStateDurationUs[oldState]) {