Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -rd96d1805307c4e4586416629081b3314037392bf -ra49d4033363206fc3ae86d8648eb5b9cc91e8dca --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision d96d1805307c4e4586416629081b3314037392bf) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision a49d4033363206fc3ae86d8648eb5b9cc91e8dca) @@ -240,7 +240,7 @@ // Initialize the blood leak calibration command sequence array. // The first index is the command character so it can be changed upon request. - // The reset of the commands are never changing. + // The rest of the commands are never changing. bloodLeakEmbModeCmdSquence[ 0 ] = 0; bloodLeakEmbModeCmdSquence[ 1 ] = BLOOD_LEAK_STOP_WRITE_FIFO_COMMAND; bloodLeakEmbModeCmdSquence[ 2 ] = BLOOD_LEAK_EMB_MODE_COMM_ACTIVE_HIGH; @@ -759,7 +759,7 @@ { state = BLOOD_LEAK_INIT_STATE; bloodLeakZeroRequested = FALSE; - bloodLeakExitNormalRequested = TRUE; + bloodLeakExitNormalRequested = FALSE; } return state; Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -rd7e01dce5b2ebb1ea02832a9ced81550a919b67b -ra49d4033363206fc3ae86d8648eb5b9cc91e8dca --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision d7e01dce5b2ebb1ea02832a9ced81550a919b67b) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision a49d4033363206fc3ae86d8648eb5b9cc91e8dca) @@ -104,8 +104,7 @@ #define DOP_PWM_ZERO_OFFSET 0.1F ///< 10% PWM duty cycle = zero speed. /// Macro converts a flow rate to an estimated PWM duty cycle %. -#define DOP_PWM_FROM_ML_PER_MIN(rate) ( ( (rate) * 0.0009 ) + 0.0972 + DOP_PWM_ZERO_OFFSET ) // TODO - need to consider BP rate? -//#define DOP_PWM_FROM_ML_PER_MIN(rate) ( (rate) * DOP_ML_PER_MIN_TO_PUMP_RPM_FACTOR * DOP_GEAR_RATIO * DOP_MOTOR_RPM_TO_PWM_DC_FACTOR + DOP_PWM_ZERO_OFFSET ) +#define DOP_PWM_FROM_ML_PER_MIN(rate) ( ( (rate) * 0.0009 ) + 0.0972 + DOP_PWM_ZERO_OFFSET ) /// Conversion from PWM duty cycle % to commanded pump motor speed. #define DOP_PWM_TO_MOTOR_SPEED_RPM(pwm) ( ((pwm) - DOP_PWM_ZERO_OFFSET) * 4000.0F ) Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -r8373758a03ea82b46b4b313d2f2b24e3974a17f6 -ra49d4033363206fc3ae86d8648eb5b9cc91e8dca --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision 8373758a03ea82b46b4b313d2f2b24e3974a17f6) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision a49d4033363206fc3ae86d8648eb5b9cc91e8dca) @@ -456,9 +456,9 @@ // and remain silent for a defined period of time. else { - S32 elapsedTime = rpmAlarmStartTime - rpmAlarmStartTimeOffset; + S32 timeDiff = rpmAlarmStartTime - rpmAlarmStartTimeOffset; - if ( calcTimeSince( elapsedTime ) >= SECONDS_IN_A_DAY * MS_PER_SECOND ) + if ( calcTimeSince( timeDiff ) >= SECONDS_IN_A_DAY * MS_PER_SECOND ) { hasAlarmBeenRaised = FALSE; rpmAlarmStartTime = 0; Index: firmware/App/Modes/TreatmentEnd.c =================================================================== diff -u -r61c6f9386e49c5f03792b82d3e6c9bacc98d384a -ra49d4033363206fc3ae86d8648eb5b9cc91e8dca --- firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 61c6f9386e49c5f03792b82d3e6c9bacc98d384a) +++ firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision a49d4033363206fc3ae86d8648eb5b9cc91e8dca) @@ -127,6 +127,9 @@ // Continue air trap control startAirTrapControl(); + // Command the blood leak to exit the normal state + exitBloodLeakNormalState(); + // Set user alarm recovery actions allowed in this sub-mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); // Resume in this sub-mode indicates resume wait for user rinseback request (not resume treatment) setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, TRUE ); Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -r61c6f9386e49c5f03792b82d3e6c9bacc98d384a -ra49d4033363206fc3ae86d8648eb5b9cc91e8dca --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 61c6f9386e49c5f03792b82d3e6c9bacc98d384a) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision a49d4033363206fc3ae86d8648eb5b9cc91e8dca) @@ -112,9 +112,6 @@ // Reset saline bolus state in case alarm interrupted one resetSalineBolus(); - // Exit blood leak normal state so there will no blood detection alarm - exitBloodLeakNormalState(); - // Should always have an alarm active in treatment stop sub-mode so that user can take action if ( FALSE == isAnyAlarmActive() ) {