Compare commits
3 Commits
730f020f41
...
e6a861185c
Author | SHA1 | Date | |
---|---|---|---|
e6a861185c | |||
e12971b971 | |||
4f5fdb7af4 |
@ -35,6 +35,20 @@
|
|||||||
#define OTA_DELAY 50 // ticks -> 10ms / tick
|
#define OTA_DELAY 50 // ticks -> 10ms / tick
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define LUBE_PULSE_LENGHT_MS 160
|
||||||
|
#define LUBE_PULSE_PAUSE_MS 340
|
||||||
|
|
||||||
|
// -> 2Hz PumpPulse
|
||||||
|
// -> 49,7cc / h @ 2Hz
|
||||||
|
// -> 49,7 ml / h @ 2Hz
|
||||||
|
// -> 828,4µl / min @ 2Hz
|
||||||
|
// -> 828,3µl / 60s
|
||||||
|
// -> 13,81µl / 1s
|
||||||
|
// -> 6,90µl / Pulse
|
||||||
|
|
||||||
|
#define DEFAULT_PUMP_DOSE 7
|
||||||
|
|
||||||
|
#define STARTUP_DELAY 5000
|
||||||
#define SHUTDOWN_DELAY_MS 5000
|
#define SHUTDOWN_DELAY_MS 5000
|
||||||
|
|
||||||
#define ATOMIC_FS_UPDATE
|
#define ATOMIC_FS_UPDATE
|
||||||
|
@ -76,7 +76,7 @@ typedef struct
|
|||||||
uint32_t DistancePerLube_Default = 8000;
|
uint32_t DistancePerLube_Default = 8000;
|
||||||
uint32_t DistancePerLube_Rain = 4000;
|
uint32_t DistancePerLube_Rain = 4000;
|
||||||
uint32_t tankCapacity_ml = 320;
|
uint32_t tankCapacity_ml = 320;
|
||||||
uint32_t amountPerDose_µl = 72;
|
uint32_t amountPerDose_µl = DEFAULT_PUMP_DOSE;
|
||||||
uint8_t TankRemindAtPercentage = 30;
|
uint8_t TankRemindAtPercentage = 30;
|
||||||
uint8_t PulsePerRevolution = 1;
|
uint8_t PulsePerRevolution = 1;
|
||||||
uint32_t TireWidth_mm = 150;
|
uint32_t TireWidth_mm = 150;
|
||||||
@ -95,7 +95,7 @@ typedef struct
|
|||||||
} LubeConfig_t;
|
} LubeConfig_t;
|
||||||
|
|
||||||
const LubeConfig_t LubeConfig_defaults{
|
const LubeConfig_t LubeConfig_defaults{
|
||||||
0, 8000, 4000, 320, 72, 30, 1, 150, 70, 18, 2000, 25, SOURCE_IMPULSE,
|
0, 8000, 4000, 320, DEFAULT_PUMP_DOSE, 30, 1, 150, 70, 18, 2000, 25, SOURCE_IMPULSE,
|
||||||
#ifdef FEATURE_ENABLE_GPS
|
#ifdef FEATURE_ENABLE_GPS
|
||||||
BAUD_115200,
|
BAUD_115200,
|
||||||
#endif
|
#endif
|
||||||
|
@ -5,7 +5,7 @@ uint32_t lubePulseTimestamp = 0;
|
|||||||
void RunLubeApp(uint32_t add_milimeters)
|
void RunLubeApp(uint32_t add_milimeters)
|
||||||
{
|
{
|
||||||
|
|
||||||
globals.TankPercentage = PersistenceData.tankRemain_µl / (LubeConfig.tankCapacity_ml * 1000);
|
globals.TankPercentage = PersistenceData.tankRemain_µl / (LubeConfig.tankCapacity_ml * 10);
|
||||||
|
|
||||||
MaintainDTC(DTC_TANK_EMPTY, DTC_CRITICAL, (PersistenceData.tankRemain_µl < LubeConfig.amountPerDose_µl));
|
MaintainDTC(DTC_TANK_EMPTY, DTC_CRITICAL, (PersistenceData.tankRemain_µl < LubeConfig.amountPerDose_µl));
|
||||||
MaintainDTC(DTC_TANK_LOW, DTC_WARN, (globals.TankPercentage < LubeConfig.TankRemindAtPercentage));
|
MaintainDTC(DTC_TANK_LOW, DTC_WARN, (globals.TankPercentage < LubeConfig.TankRemindAtPercentage));
|
||||||
|
@ -8,10 +8,6 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "dtc.h"
|
#include "dtc.h"
|
||||||
|
|
||||||
#define LUBE_PULSE_LENGHT_MS 160
|
|
||||||
#define LUBE_PULSE_PAUSE_MS 100
|
|
||||||
#define STARTUP_DELAY 5000
|
|
||||||
|
|
||||||
void RunLubeApp(uint32_t add_milimeters);
|
void RunLubeApp(uint32_t add_milimeters);
|
||||||
void LubePulse();
|
void LubePulse();
|
||||||
|
|
||||||
|
@ -77,6 +77,7 @@ void RemoteDebug_CheckEEPOM();
|
|||||||
void RemoteDebug_dumpConfig();
|
void RemoteDebug_dumpConfig();
|
||||||
void RemoteDebug_dumpPersistance();
|
void RemoteDebug_dumpPersistance();
|
||||||
void RemoteDebug_ShowDTCs();
|
void RemoteDebug_ShowDTCs();
|
||||||
|
void RemoteDebug_dumpGlobals();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
||||||
@ -287,9 +288,11 @@ void processCmdRemoteDebug()
|
|||||||
else if (lastCmd == "dumpPDS")
|
else if (lastCmd == "dumpPDS")
|
||||||
RemoteDebug_dumpPersistance();
|
RemoteDebug_dumpPersistance();
|
||||||
else if (lastCmd == "saveEE")
|
else if (lastCmd == "saveEE")
|
||||||
globals.requestEEAction == EE_ALL_SAVE;
|
globals.requestEEAction = EE_ALL_SAVE;
|
||||||
else if (lastCmd == "showdtc")
|
else if (lastCmd == "showdtc")
|
||||||
RemoteDebug_ShowDTCs();
|
RemoteDebug_ShowDTCs();
|
||||||
|
else if (lastCmd == "dumpGlobals")
|
||||||
|
RemoteDebug_dumpGlobals();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteDebug_formatCFG()
|
void RemoteDebug_formatCFG()
|
||||||
@ -350,6 +353,20 @@ void RemoteDebug_dumpConfig()
|
|||||||
debugA("checksum: 0x%08X", LubeConfig.checksum);
|
debugA("checksum: 0x%08X", LubeConfig.checksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RemoteDebug_dumpGlobals()
|
||||||
|
{
|
||||||
|
debugA("systemStatus: %d", globals.systemStatus);
|
||||||
|
debugA("resumeStatus: %d", globals.resumeStatus);
|
||||||
|
debugA("systemStatustxt: %s", globals.systemStatustxt);
|
||||||
|
debugA("purgePulses: %d", globals.purgePulses);
|
||||||
|
debugA("requestEEAction: %d", globals.requestEEAction);
|
||||||
|
debugA("DeviceName: %s", globals.DeviceName);
|
||||||
|
debugA("FlashVersion: %s", globals.FlashVersion);
|
||||||
|
debugA("eePersistanceAdress: %d", globals.eePersistanceAdress);
|
||||||
|
debugA("TankPercentage: %d", globals.TankPercentage);
|
||||||
|
debugA("hasDTC: %d", globals.hasDTC);
|
||||||
|
}
|
||||||
|
|
||||||
void RemoteDebug_dumpPersistance()
|
void RemoteDebug_dumpPersistance()
|
||||||
{
|
{
|
||||||
debugA("writeCycleCounter: %d", PersistenceData.writeCycleCounter);
|
debugA("writeCycleCounter: %d", PersistenceData.writeCycleCounter);
|
||||||
|
@ -9,4 +9,5 @@ const char helpCmd[] = "sysinfo - System Info\r\n"
|
|||||||
"dumpCFG - print Config struct\r\n"
|
"dumpCFG - print Config struct\r\n"
|
||||||
"dumpPDS - print PersistanceStruct\r\n"
|
"dumpPDS - print PersistanceStruct\r\n"
|
||||||
"saveEE - save EE-Data\r\n"
|
"saveEE - save EE-Data\r\n"
|
||||||
"showdtc - Show all DTCs\r\n";
|
"showdtc - Show all DTCs\r\n"
|
||||||
|
"dumpGlobals - print globals\r\n";
|
@ -323,6 +323,11 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request)
|
|||||||
globals.requestEEAction = globals.requestEEAction == EE_PDS_FORMAT ? EE_FORMAT_ALL : EE_CFG_FORMAT;
|
globals.requestEEAction = globals.requestEEAction == EE_PDS_FORMAT ? EE_FORMAT_ALL : EE_CFG_FORMAT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p->name() == "purgenow")
|
||||||
|
{
|
||||||
|
globals.systemStatus = sysStat_Purge;
|
||||||
|
globals.purgePulses = LubeConfig.BleedingPulses;
|
||||||
|
}
|
||||||
// end: POST Form Maintenance
|
// end: POST Form Maintenance
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user