aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/IFS
diff options
context:
space:
mode:
authorRonen Sberlo <ronen.s@twine-s.com>2020-11-17 14:06:49 +0200
committerRonen Sberlo <ronen.s@twine-s.com>2020-11-17 14:06:49 +0200
commit914112a7e6d62c4561577ef959f7aff79bd686eb (patch)
tree4af822635c3328751d9c28f114279a4c9ccc5ec9 /Software/Embedded_SW/Embedded/Modules/IFS
parent618d8e5006d19aad8cf57c4a3ffb7c8293292b90 (diff)
downloadTango-914112a7e6d62c4561577ef959f7aff79bd686eb.tar.gz
Tango-914112a7e6d62c4561577ef959f7aff79bd686eb.zip
ppc status ifs/waste complete fix
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/IFS')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IFS/ifs.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
index 9f7a342ba..469e82aa8 100644
--- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
+++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c
@@ -157,9 +157,20 @@ bool CartridgeInkFull()
int GetCartridgeFillPercent()
{
double MidTank_Pressure = 0;
-
+#ifdef IFS_DEBUG
+ static int percent = 0;
+ if (midTankState == MidTankStateFilling) {
+ if (percent < 100) {
+ percent += 1;
+ }
+ } else {
+ percent = 0;
+ }
+ return percent;
+#else
MidTank_Pressure = Read_MidTank_Pressure_Sensor(midTankCartColor);
return (((MidTank_Pressure - midTankCapacity)* 100) / CARTRIDGE_CAPATICY);
+#endif
}
bool midTankCart_door()
@@ -378,7 +389,8 @@ void midTankStateMachine(void)
// RFID change status - inkEmpty
CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__FillingCompleted, 100.0);
}
- CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Filling, GetCartridgeFillPercent());
+ if (midTankState == MidTankStateFilling)
+ CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Filling, GetCartridgeFillPercent());
break;
default:
Report("wrong state", __FILE__, __LINE__, midTankState, RpMessage, 0, 0);