Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r63e96158c3d4bff91167b2a0656a63f78ede8b41 -r7d7129ebe8a98694bea7cf4118f3bedf62f2157b --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 63e96158c3d4bff91167b2a0656a63f78ede8b41) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 7d7129ebe8a98694bea7cf4118f3bedf62f2157b) @@ -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" @@ -254,6 +255,8 @@ *************************************************************************/ U32 execBalancingChamberControl( void ) { + LVL_STATE_T bicarbChamberLevel = getBicarbChamberLevelStatus(); + updateBalChamberSwitchingPeriod(); // Increment counter indicating fill is in progress. @@ -262,6 +265,20 @@ 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 )