m_consumedRemainder busy loop

This commit is contained in:
rusefillc 2024-11-17 12:12:10 -05:00
parent 2f896948ba
commit 15bf24eee9
1 changed files with 2 additions and 1 deletions

View File

@ -15,11 +15,12 @@ void TripOdometer::reset() {
void TripOdometer::consumeFuel(float grams, efitick_t nowNt) {
m_consumedRemainder += grams;
criticalAssertVoid(m_consumedRemainder < 1000, "m_consumedRemainder busy loop");
while (m_consumedRemainder > 1) {
m_consumedRemainder--;
m_consumedGrams++;
}
m_consumedGrams += grams;
float elapsedSecond = m_timer.getElapsedSecondsAndReset(nowNt);