fixed overflow of remaining tank
This commit is contained in:
parent
f3ce691b7d
commit
8e6941b5bc
@ -79,5 +79,8 @@ void RunLubeApp(volatile uint32_t *wheelPulseCounter)
|
||||
void LubePulse()
|
||||
{
|
||||
lubePulseTimestamp = millis() + LUBE_PULSE_LENGHT_MS;
|
||||
LubeConfig.tankRemain_µl = LubeConfig.tankRemain_µl - LubeConfig.amountPerDose_µl;
|
||||
if (PersistenceData.tankRemain_µl < LubeConfig.amountPerDose_µl)
|
||||
PersistenceData.tankRemain_µl = 0;
|
||||
else
|
||||
PersistenceData.tankRemain_µl = PersistenceData.tankRemain_µl - LubeConfig.amountPerDose_µl;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user