prevent Lube if Tank is empty (DryRun-Protection)
This commit is contained in:
parent
2ada3d9a61
commit
812a094e50
@ -121,9 +121,13 @@ void RunLubeApp(uint32_t add_milimeters)
|
||||
|
||||
void LubePulse()
|
||||
{
|
||||
lubePulseTimestamp = millis() + LUBE_PULSE_LENGHT_MS;
|
||||
if (PersistenceData.tankRemain_µl < LubeConfig.amountPerDose_µl)
|
||||
PersistenceData.tankRemain_µl = 0;
|
||||
else
|
||||
PersistenceData.tankRemain_µl = PersistenceData.tankRemain_µl - LubeConfig.amountPerDose_µl;
|
||||
if (PersistenceData.tankRemain_µl > 0) // Only Lube if theres Oil remaining!
|
||||
{
|
||||
lubePulseTimestamp = millis() + LUBE_PULSE_LENGHT_MS;
|
||||
|
||||
if (PersistenceData.tankRemain_µl < LubeConfig.amountPerDose_µl) // Prevent underrun and shiftover
|
||||
PersistenceData.tankRemain_µl = 0;
|
||||
else
|
||||
PersistenceData.tankRemain_µl = PersistenceData.tankRemain_µl - LubeConfig.amountPerDose_µl;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user