Index: firmware/App/Controllers/UVReactors.c =================================================================== diff -u -r3b91172ed6cd004627473dc1dd1d71bf7a87f0d6 -r92708a5ab23026f5c9afce66bfa542c84141011a --- firmware/App/Controllers/UVReactors.c (.../UVReactors.c) (revision 3b91172ed6cd004627473dc1dd1d71bf7a87f0d6) +++ firmware/App/Controllers/UVReactors.c (.../UVReactors.c) (revision 92708a5ab23026f5c9afce66bfa542c84141011a) @@ -321,7 +321,7 @@ BOOL isOutletHealthy = (BOOL)getReactorHealth( OUTLET_UV_REACTOR ); // Check if both of them are healthy and if not, raise an alarm - if ( ( TRUE == isInletHealthy ) &&( TRUE == isOutletHealthy ) ) + if ( ( TRUE == isInletHealthy ) && ( TRUE == isOutletHealthy ) ) { uvReactorsSelfTestResult = SELF_TEST_STATUS_PASSED; } @@ -401,8 +401,17 @@ // Check if the alarm has been active if ( TRUE == isAlarmActive( ALARM_ID_UV_REACTOR_NOT_HEALTHY ) ) { - reactorsStatus[ reactor ].switchState = TURN_OFF; - reactorsStatus[ reactor ].healthStatus.data = UV_REACTOR_OFF; + reactorsStatus[ reactor ].switchState = TURN_OFF; + + // Check if the health status is overridden or not and then update the reactor's health + if ( OVERRIDE_KEY == reactorsStatus[ reactor ].healthStatus.override ) + { + reactorsStatus[ reactor ].healthStatus.ovData = UV_REACTOR_OFF; + } + else + { + reactorsStatus[ reactor ].healthStatus.data = UV_REACTOR_OFF; + } } // Check if it has been requested to turn off a reactor Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r4b208641ed0c22d13211e6343ffaec9778560cc5 -r92708a5ab23026f5c9afce66bfa542c84141011a --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 4b208641ed0c22d13211e6343ffaec9778560cc5) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 92708a5ab23026f5c9afce66bfa542c84141011a) @@ -17,6 +17,7 @@ #include // for memcpy() +#include "DrainPump.h" #include "Heaters.h" #include "LoadCell.h" #include "MessageSupport.h" @@ -47,7 +48,8 @@ #define MIN_DRAIN_INLET_PSI_EMPTY -3.0 ///< Minimum drain inlet pressure (in PSI) to indicate reservoir is empty while drain pump on. #define RESERVOIR_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< interval (ms/task time) at which the reservoir data is published on the CAN bus. #define MAX_REDUNDANT_LOAD_CELL_DIFF 50.0 ///< Maximum difference in redundant load cells when determining if fill completed. -#define DRAIN_THRESHOLD_ML 1.0 ///< Drain threshold in milliliters. +// 2400 rpm is ~ 2400 mL/min and it results 1 mL of flow change. +#define DRAIN_THRESHOLD_ML(rpm) ( (F32)rpm / 2400.0 ) ///< Drain threshold in milliliters. #define DATA_PUBLISH_COUNTER_START_COUNT 5 ///< Data publish counter start count. // ********** private data ********** @@ -681,16 +683,15 @@ // ready to consider this the end of the reservoir flow // If the wait for drain to steady has elapsed and the drain pump inlet pressure sensor is indicating and increased vacuum, // signal the drain is complete - if ( ( drainFlowML <= DRAIN_THRESHOLD_ML ) && ( 0 == reservoirWeightUnchangeStartTime[ reservoirId ] ) ) + if ( ( drainFlowML <= DRAIN_THRESHOLD_ML( getDrainPumpTargetRPM() ) ) && ( 0 == reservoirWeightUnchangeStartTime[ reservoirId ] ) ) { reservoirWeightUnchangeStartTime[ reservoirId ] = getMSTimerCount(); } - else if ( drainFlowML > DRAIN_THRESHOLD_ML ) + else if ( drainFlowML > DRAIN_THRESHOLD_ML( getDrainPumpTargetRPM() ) ) { reservoirWeightUnchangeStartTime[ reservoirId ] = 0; } - // TODO make a #define if the extra 1000 ms worked - else if ( ( TRUE == didTimeout( reservoirWeightUnchangeStartTime[ reservoirId ], timeout + 1000 ) && + else if ( ( TRUE == didTimeout( reservoirWeightUnchangeStartTime[ reservoirId ], timeout ) && ( getMeasuredDGPressure( PRESSURE_SENSOR_DRAIN_PUMP_INLET ) > MIN_DRAIN_INLET_PSI_EMPTY ) ) ) { result = TRUE;