1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 17:55:30 +03:00

Put execution time at the end

This commit is contained in:
ctzsnooze 2022-06-13 21:48:02 +10:00
parent e5a882d861
commit 5989d7b067

View file

@ -860,13 +860,6 @@ void gpsUpdate(timeUs_t currentTimeUs)
break; break;
} }
executeTimeUs = micros() - currentTimeUs;
if (executeTimeUs > gpsStateDurationUs[gpsCurrentState]) {
gpsStateDurationUs[gpsCurrentState] = executeTimeUs;
}
schedulerSetNextStateTime(gpsStateDurationUs[gpsData.state]);
if (sensors(SENSOR_GPS)) { if (sensors(SENSOR_GPS)) {
updateGpsIndicator(currentTimeUs); updateGpsIndicator(currentTimeUs);
} }
@ -893,6 +886,12 @@ void gpsUpdate(timeUs_t currentTimeUs)
} else { } else {
hasFix = false; hasFix = false;
} }
executeTimeUs = micros() - currentTimeUs;
if (executeTimeUs > gpsStateDurationUs[gpsCurrentState]) {
gpsStateDurationUs[gpsCurrentState] = executeTimeUs;
}
schedulerSetNextStateTime(gpsStateDurationUs[gpsData.state]);
} }
static void gpsNewData(uint16_t c) static void gpsNewData(uint16_t c)