diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-11-01 11:22:04 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-11-01 11:22:04 +0200 |
| commit | f6ce72affbf47dc59bade103ea9d3922da6c8b21 (patch) | |
| tree | 855ecbc8d1e81728282c22cc351d9a0caaa0e7ca /Software/Embedded_SW | |
| parent | 8a0e31c1bfbe460795b9653c0dff0acdd4742e7d (diff) | |
| parent | 77bfce8dd9b9b4f703b719fbe9f7c3472a8d3cf2 (diff) | |
| download | Tango-f6ce72affbf47dc59bade103ea9d3922da6c8b21.tar.gz Tango-f6ce72affbf47dc59bade103ea9d3922da6c8b21.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 83755376f..85317589c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -266,6 +266,10 @@ int WHS_GetCartridgeFillPercent() { return (((wasteLevel - wasteLevelEmpty) * 100) / WASTE_CARTRIDGE_SIZE); } +int WHS_GetCartridgeFill() +{ + return (wasteLevelFull - wasteLevel); +} bool WHS_IsContainerFull() { return RdWasteTankFullSensor(); @@ -392,6 +396,7 @@ void Waste_StateMachine_OneSecond_Call(void) void Waste_StateMachine(void) { uint32_t activeCart; + char str[100]; switch (WasteTankState) { case WasteTankStateIdle: @@ -449,6 +454,7 @@ void Waste_StateMachine(void) // set emptying limit wasteLevelEmpty = wasteLevel - WASTE_CARTRIDGE_SIZE; + wasteLevelFull = wasteLevel; waste_seq_step1_cont(); // start a timer to observe door opening @@ -470,7 +476,8 @@ void Waste_StateMachine(void) SetWastePump(CLOSE); cartFILLING_END(); WasteTankState = WasteTankStateIdle; - Report("WasteTankStateEmptying TimeOut", __FILE__, __LINE__, 0, RpMessage, 0, 0); + usnprintf(str, 100, "WasteTankStateEmptying Timeout. time:%d:%d volume:%d", timeout_counter/60, timeout_counter%60, WHS_GetCartridgeFill()); + Report(str, __FILE__, __LINE__, 0, RpMessage, 0, 0); CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Error, WHS_GetCartridgeFillPercent()); AlarmHandlingSetAlarm( EVENT_TYPE__WASTE_CONTAINER_EMPTYING_TIMEOUT, true); RemoveControlCallback(Cartridge_Cover_Control, Waste_DoorOpenDuringEmptying); @@ -484,7 +491,8 @@ void Waste_StateMachine(void) RemoveControlCallback(Cartridge_Cover_Control, Waste_DoorOpenDuringEmptying); //if (cartNotAllFull() == false) AlarmHandlingSetAlarm( EVENT_TYPE__ALL_WASTE_CARTRIDGES_FULL, true); - Report("WasteTankStateEmptying done", __FILE__, __LINE__, 0, RpMessage, 0, 0); + usnprintf(str, 100, "WasteTankStateEmptying done. time:%d:%d volume:%d", timeout_counter/60, timeout_counter%60, WHS_GetCartridgeFill()); + Report(str, __FILE__, __LINE__, 0, RpMessage, 0, 0); CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__EmptyingCompleted, WHS_GetCartridgeFillPercent()); timeout_counter = 0; } |
