Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rfd897db8177752330ad08d877e0a13620513dbdc -r37d6f3341f62349589f63975779c0df952c0cfd4 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision fd897db8177752330ad08d877e0a13620513dbdc) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 37d6f3341f62349589f63975779c0df952c0cfd4) @@ -22,6 +22,7 @@ #include "DryBiCart.h" #include "FpgaDD.h" #include "Heaters.h" +#include "Level.h" #include "ModeGenDialysate.h" #include "ModeStandby.h" #include "Messaging.h" @@ -256,12 +257,28 @@ { updateBalChamberSwitchingPeriod(); + LVL_STATE_T bicarbChamberLevel = getBicarbChamberLevelStatus(); + // Increment counter indicating fill is in progress. currentBalChamberSwitchingCounter += 1; currentBalChamberFillCounter += 1; if ( ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) == TRUE ) && ( balChamberExecState > BAL_CHAMBER_STATE_IDLE ) ) { +#ifdef CONDUCTIVE_LEVEL_SENSOR_ENABLED + if ( LVL_STATE_LOW == bicarbChamberLevel ) + { + if ( getCurrentBalancingChamberExecState() > BAL_CHAMBER_STATE_IDLE ) + { + if ( FALSE == setBicarbChamberFillRequested() ) + { + // TODO + //drybicart state machines are combined and so this is not an issue in future + //set alarm ? + } + } + } +#else // time based chamber F fill // Increment counter for dry bicarb chamber fill bicarbChamberPeriodicFillCounter += 1; // Fill bicarb chamber once every 60secs. @@ -275,6 +292,7 @@ } bicarbChamberPeriodicFillCounter = 0; } +#endif } switch ( balChamberExecState )