implemented Wash-Mode
This commit is contained in:
@@ -29,6 +29,7 @@ uint32_t lubePulseTimestamp = 0;
|
||||
void RunLubeApp(uint32_t add_milimeters)
|
||||
{
|
||||
static tSystem_Status lastSystemStatus = sysStat_Startup;
|
||||
static uint16_t washModeDistance = 0;
|
||||
|
||||
// Calculate and update tank percentage
|
||||
globals.TankPercentage = PersistenceData.tankRemain_microL / (LubeConfig.tankCapacity_ml * 10);
|
||||
@@ -102,6 +103,32 @@ void RunLubeApp(uint32_t add_milimeters)
|
||||
}
|
||||
break;
|
||||
|
||||
case sysStat_Wash:
|
||||
if (lastSystemStatus != globals.systemStatus)
|
||||
{
|
||||
washModeDistance = LubeConfig.WashMode_Distance;
|
||||
strcpy_P(globals.systemStatustxt, PSTR("Wash"));
|
||||
LEDControl_SetBasic(LED_WASH_COLOR, LED_PATTERN_BREATH);
|
||||
lastSystemStatus = globals.systemStatus;
|
||||
}
|
||||
|
||||
// Trigger lube pulse if traveled distance exceeds the configured Interval in Wash mode
|
||||
if (PersistenceData.TravelDistance_highRes_mm / 1000 > LubeConfig.WashMode_Interval)
|
||||
{
|
||||
LubePulse();
|
||||
PersistenceData.TravelDistance_highRes_mm = 0;
|
||||
|
||||
if (washModeDistance >= LubeConfig.WashMode_Distance)
|
||||
{
|
||||
washModeDistance = washModeDistance - LubeConfig.WashMode_Interval;
|
||||
}
|
||||
else
|
||||
{
|
||||
globals.systemStatus = globals.resumeStatus;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case sysStat_Purge:
|
||||
if (lastSystemStatus != globals.systemStatus)
|
||||
{
|
||||
|
Reference in New Issue
Block a user