1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 09:45:37 +03:00

Merge pull request #10609 from SteveCEvans/rx_state

This commit is contained in:
Michael Keller 2021-03-28 16:41:11 +13:00 committed by GitHub
commit 2278ffd1d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 88 additions and 19 deletions

View file

@ -51,6 +51,8 @@
#include "sensors/sensors.h"
#include "scheduler/scheduler.h"
#include "barometer.h"
baro_t baro; // barometer access functions
@ -385,6 +387,12 @@ uint32_t baroUpdate(void)
debug[0] = state;
}
// Tell the scheduler to ignore how long this task takes unless the pressure is being read
// as that takes the longest
if (state != BAROMETER_NEEDS_PRESSURE_READ) {
ignoreTaskTime();
}
switch (state) {
default:
case BAROMETER_NEEDS_TEMPERATURE_START:
@ -414,6 +422,8 @@ uint32_t baroUpdate(void)
case BAROMETER_NEEDS_PRESSURE_READ:
if (baro.dev.read_up(&baro.dev)) {
state = BAROMETER_NEEDS_PRESSURE_SAMPLE;
} else {
ignoreTaskTime();
}
break;