1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +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;
}
executeTimeUs = micros() - currentTimeUs;
if (executeTimeUs > gpsStateDurationUs[gpsCurrentState]) {
gpsStateDurationUs[gpsCurrentState] = executeTimeUs;
}
schedulerSetNextStateTime(gpsStateDurationUs[gpsData.state]);
if (sensors(SENSOR_GPS)) {
updateGpsIndicator(currentTimeUs);
}
@ -893,6 +886,12 @@ void gpsUpdate(timeUs_t currentTimeUs)
} else {
hasFix = false;
}
executeTimeUs = micros() - currentTimeUs;
if (executeTimeUs > gpsStateDurationUs[gpsCurrentState]) {
gpsStateDurationUs[gpsCurrentState] = executeTimeUs;
}
schedulerSetNextStateTime(gpsStateDurationUs[gpsData.state]);
}
static void gpsNewData(uint16_t c)