Fix BARO task rate display

This commit is contained in:
Steve Evans 2022-01-15 21:32:54 +00:00
parent 815cb41d30
commit 6a933478d2
1 changed files with 9 additions and 9 deletions

View File

@ -388,11 +388,6 @@ uint32_t baroUpdate(timeUs_t currentTimeUs)
DEBUG_SET(DEBUG_BARO, 0, state); 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 (busBusy(&baro.dev.dev, NULL)) {
// If the bus is busy, simply return to have another go later // If the bus is busy, simply return to have another go later
schedulerIgnoreTaskStateTime(); schedulerIgnoreTaskStateTime();
@ -412,7 +407,7 @@ uint32_t baroUpdate(timeUs_t currentTimeUs)
state = BARO_STATE_TEMPERATURE_SAMPLE; state = BARO_STATE_TEMPERATURE_SAMPLE;
} else { } else {
// No action was taken as the read has not completed // No action was taken as the read has not completed
schedulerIgnoreTaskStateTime(); schedulerIgnoreTaskExecTime();
} }
break; break;
@ -421,7 +416,7 @@ uint32_t baroUpdate(timeUs_t currentTimeUs)
state = BARO_STATE_PRESSURE_START; state = BARO_STATE_PRESSURE_START;
} else { } else {
// No action was taken as the read has not completed // No action was taken as the read has not completed
schedulerIgnoreTaskStateTime(); schedulerIgnoreTaskExecTime();
} }
break; break;
@ -436,14 +431,14 @@ uint32_t baroUpdate(timeUs_t currentTimeUs)
state = BARO_STATE_PRESSURE_SAMPLE; state = BARO_STATE_PRESSURE_SAMPLE;
} else { } else {
// No action was taken as the read has not completed // No action was taken as the read has not completed
schedulerIgnoreTaskStateTime(); schedulerIgnoreTaskExecTime();
} }
break; break;
case BARO_STATE_PRESSURE_SAMPLE: case BARO_STATE_PRESSURE_SAMPLE:
if (!baro.dev.get_up(&baro.dev)) { if (!baro.dev.get_up(&baro.dev)) {
// No action was taken as the read has not completed // No action was taken as the read has not completed
schedulerIgnoreTaskStateTime(); schedulerIgnoreTaskExecTime();
break; break;
} }
@ -465,6 +460,11 @@ uint32_t baroUpdate(timeUs_t currentTimeUs)
break; 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; executeTimeUs = micros() - currentTimeUs;
if (executeTimeUs > baroStateDurationUs[oldState]) { if (executeTimeUs > baroStateDurationUs[oldState]) {