Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -rc3ad9ff5401aed42da66a2f47c7d02332f9fd1b5 -r1223d5caafbd260f9a62e922cbf54165b1254ff9 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision c3ad9ff5401aed42da66a2f47c7d02332f9fd1b5) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 1223d5caafbd260f9a62e922cbf54165b1254ff9) @@ -860,10 +860,13 @@ { salineBolusStartRequested = FALSE; // Cmd all pumps to stop - setBloodPumpTargetFlowRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); - setDialInPumpTargetFlowRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); - setDialOutPumpTargetRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); - stopSyringePump(); + stopDialysis(); +/* + * setBloodPumpTargetFlowRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + * setDialInPumpTargetFlowRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + * setDialOutPumpTargetRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + * stopSyringePump(); + */ // Begin saline bolus result = SALINE_BOLUS_STATE_WAIT_FOR_PUMPS_STOP; } @@ -888,7 +891,6 @@ // Reset bolus data before we start bolusSalineVolumeDelivered_mL = 0.0; bolusSalineLastVolumeTimeStamp = getMSTimerCount(); - // Bypass dialyzer setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rb3076db63d3e6515746948fba3a4c2bf9aad9c27 -r1223d5caafbd260f9a62e922cbf54165b1254ff9 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision b3076db63d3e6515746948fba3a4c2bf9aad9c27) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 1223d5caafbd260f9a62e922cbf54165b1254ff9) @@ -254,6 +254,33 @@ /*********************************************************************//** * @brief + * The isACPowerLost function determines whether A/C power loss has + * been detected. This function sets the alarms blocked condition to + * allow smooth alarm recovery. + * + * @details Inputs: alarmStatus + * @details Outputs: alarmsBlockedTimer + * @return TRUE if A/C power loss alarm is in effect, FALSE if not + *************************************************************************/ +BOOL isACPowerLost( void ) +{ + BOOL result = TRUE; + + // Continue to block new alarms until the alarms are cleared. + if ( ( FALSE == isAlarmConditionDetected( ALARM_ID_HD_AC_POWER_LOST ) ) && + ( FALSE == isAlarmConditionDetected( ALARM_ID_HD_AC_POWER_LOST_IN_TREATMENT ) ) ) + { + result = FALSE; + } + else + { + alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; + } + return result; +} + +/*********************************************************************//** + * @brief * The activateAlarm function activates a given alarm. * @details Inputs: none * @details Outputs: alarmIsActive[], alarmStartedAt[], alarmStatus is updated @@ -262,6 +289,11 @@ *************************************************************************/ static void activateAlarm( ALARM_ID_T alarm ) { + // Block new alarms, occuring during loss of AC power + if ( ( TRUE == getCPLDACPowerLossDetected() ) ) + { + alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; + } // Verify valid alarm index if ( ( alarm > ALARM_ID_NO_ALARM ) && ( alarm < NUM_OF_ALARM_IDS ) ) { @@ -358,12 +390,7 @@ * @return none *************************************************************************/ void activateAlarm2Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData1, ALARM_DATA_T alarmData2 ) -{ - // Block if new alarms are occur during loss of AC power - if ( ( TRUE == getCPLDACPowerLossDetected() ) ) - { - alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; - } +{ // Sanity check, verify valid alarm index if ( ( alarm > ALARM_ID_NO_ALARM ) && ( alarm < NUM_OF_ALARM_IDS ) ) { Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r9727a7470bf773abebddc504ef4a62bf40d2bf0d -r1223d5caafbd260f9a62e922cbf54165b1254ff9 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 9727a7470bf773abebddc504ef4a62bf40d2bf0d) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 1223d5caafbd260f9a62e922cbf54165b1254ff9) @@ -5451,6 +5451,7 @@ if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) { memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) { result = testSetBatteryRemainingCapacityOverride( payload.state.f32 );