From f01c91fbc6c61cf8f7b0208926f94979014b987e Mon Sep 17 00:00:00 2001 From: Ronen Sberlo Date: Sun, 1 Nov 2020 11:01:07 +0200 Subject: add debug print for waste empty complete --- Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') 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; } -- cgit v1.3.1