Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -rc3ad9ff5401aed42da66a2f47c7d02332f9fd1b5 -re7c4a51e6057f0cc83fabc72f2df9bb5dffee391 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision c3ad9ff5401aed42da66a2f47c7d02332f9fd1b5) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision e7c4a51e6057f0cc83fabc72f2df9bb5dffee391) @@ -22,8 +22,8 @@ #include "gio.h" #include "reg_het.h" -#include "Battery.h" #include "BloodFlow.h" +#include "CPLD.h" #include "FPGA.h" #include "InternalADC.h" #include "NVDataMgmt.h" @@ -1261,7 +1261,7 @@ BOOL const isRunningMCCurrentBad = ( ( BLOOD_PUMP_OFF_STATE != bloodPumpState ) && ( bpCurr > BP_MAX_CURR_WHEN_RUNNING_MA ) ? TRUE : FALSE ); if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_BLOOD_PUMP_MC_CURRENT_CHECK, isOffMCCurrentBad || isRunningMCCurrentBad ) ) && - ( FALSE == isACPowerLost() ) ) + ( getCPLDACPowerLossDetected() != TRUE ) ) { #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_MOTOR_CURRNT_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -rffaf9f13166d7a9beb4252fad804c488f870aaaa -re7c4a51e6057f0cc83fabc72f2df9bb5dffee391 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision ffaf9f13166d7a9beb4252fad804c488f870aaaa) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision e7c4a51e6057f0cc83fabc72f2df9bb5dffee391) @@ -17,7 +17,7 @@ #include // To check for NaN -#include "Battery.h" +#include "CPLD.h" #include "DialInFlow.h" #include "Dialysis.h" #include "DGDefs.h" @@ -233,7 +233,7 @@ *************************************************************************/ void execDGInterfaceMonitor( void ) { - if ( isACPowerLost() != TRUE ) + if ( getCPLDACPowerLossDetected() != TRUE ) { // Trigger alarm if not receiving new load cell data message in timely manner checkDGDataFreshness( ALARM_ID_HD_NEW_LOAD_CELL_DATA_MESSAGE_NOT_RECEIVE, &dgLoadCellDataFreshFlag ); @@ -1310,7 +1310,7 @@ U32 trimmerState = dgHeatersData.trimmerHeaterState; DG_OP_MODE_T dgOp = getDGOpMode(); - if ( isACPowerLost() != TRUE ) + if ( getCPLDACPowerLossDetected() != TRUE ) { if ( ( DG_MODE_GENE == dgOp ) || ( DG_MODE_FILL == dgOp ) || ( DG_MODE_DRAI == dgOp ) ) { Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r9353792f6dbd624a1d55cf1e87fa848e8fbaea71 -re7c4a51e6057f0cc83fabc72f2df9bb5dffee391 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 9353792f6dbd624a1d55cf1e87fa848e8fbaea71) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision e7c4a51e6057f0cc83fabc72f2df9bb5dffee391) @@ -22,7 +22,7 @@ #include "mibspi.h" #include "reg_het.h" -#include "Battery.h" +#include "CPLD.h" #include "DialInFlow.h" #include "FPGA.h" #include "InternalADC.h" @@ -514,7 +514,7 @@ } else { // Alarm if not receiving new dialysate flow readings in timely manner - if ( ( TRUE == isDGCommunicating() ) && ( isACPowerLost() != TRUE ) ) + if ( ( TRUE == isDGCommunicating() ) && ( getCPLDACPowerLossDetected() != TRUE ) ) { if ( ++dialysateFlowDataFreshStatusCounter > DIP_DIALYSATE_FLOW_DATA_ALARM_THRESHOLD ) { @@ -1448,7 +1448,7 @@ F32 dipCurr; // only check current when we have A/C power - if ( FALSE == isACPowerLost() ) + if ( getCPLDACPowerLossDetected() != TRUE ) { // DialIn pump should be off if ( DIAL_IN_PUMP_OFF_STATE == dialInPumpState ) Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -r9353792f6dbd624a1d55cf1e87fa848e8fbaea71 -re7c4a51e6057f0cc83fabc72f2df9bb5dffee391 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 9353792f6dbd624a1d55cf1e87fa848e8fbaea71) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision e7c4a51e6057f0cc83fabc72f2df9bb5dffee391) @@ -1199,7 +1199,7 @@ F32 dopCurr; // only check current when we have A/C power - if ( FALSE == isACPowerLost() ) + if ( getCPLDACPowerLossDetected() != TRUE ) { // DialOut pump should be off if ( DIAL_OUT_PUMP_OFF_STATE == dialOutPumpState ) Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -r1bff8e530735be63ba557b77557a0bc2ac4b37b2 -re7c4a51e6057f0cc83fabc72f2df9bb5dffee391 --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision 1bff8e530735be63ba557b77557a0bc2ac4b37b2) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision e7c4a51e6057f0cc83fabc72f2df9bb5dffee391) @@ -18,7 +18,7 @@ #include // For fabs #include "etpwm.h" -#include "Battery.h" +#include "CPLD.h" #include "Fans.h" #include "FPGA.h" #include "PersistentAlarm.h" @@ -413,7 +413,7 @@ F32 fansMinAllowedRPM = fansNominalRPM - ( fansNominalRPM * FANS_MIN_RPM_OUT_OF_RANGE_TOL ); F32 fansMaxAllowedRPM = fansNominalRPM + ( fansNominalRPM * FANS_MAX_RPM_OUT_OF_RANGE_TOL ); - if ( isACPowerLost() != TRUE ) + if ( getCPLDACPowerLossDetected() != TRUE ) { // Loop through the fans and make sure the each of them have RPM in range for ( fan = FAN_INLET_1; fan < NUM_OF_FANS_NAMES; fan++ ) Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r82bd1d24c050e79690a7f5b236e49dd7db7e2a91 -re7c4a51e6057f0cc83fabc72f2df9bb5dffee391 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 82bd1d24c050e79690a7f5b236e49dd7db7e2a91) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision e7c4a51e6057f0cc83fabc72f2df9bb5dffee391) @@ -19,7 +19,7 @@ #include "reg_het.h" #include "gio.h" -#include "Battery.h" +#include "CPLD.h" #include "FPGA.h" #include "MessageSupport.h" #include "NVDataMgmt.h" @@ -925,7 +925,7 @@ state = VALVE_STATE_IDLE; } // Check if the valve's transition time has timed out - else if ( ( TRUE == didTimeout( valvesStatus[ valve ].transitionStartTime, VALVE_TRANSITION_TIMEOUT_MS ) ) && ( FALSE == isACPowerLost() ) ) + else if ( ( TRUE == didTimeout( valvesStatus[ valve ].transitionStartTime, VALVE_TRANSITION_TIMEOUT_MS ) ) && ( getCPLDACPowerLossDetected() != TRUE ) ) { // Go back to Idle state and set the valve position to not in position because it was not able to get to the target position valvesStatus[ valve ].currentPosition = VALVE_POSITION_NOT_IN_POSITION; @@ -1187,7 +1187,7 @@ for ( valve = VDI; valve < NUM_OF_VALVES; valve++ ) { // Check the valve is in Idle state, otherwise the position should not be checked - if ( ( valvesStatus[ valve ].execState == VALVE_STATE_IDLE ) && ( FALSE == isACPowerLost() ) ) + if ( ( valvesStatus[ valve ].execState == VALVE_STATE_IDLE ) && ( getCPLDACPowerLossDetected() != TRUE ) ) { U32 maxDeviation = MAX_DEVIATION_FROM_TARGET_IN_COUNTS; Index: firmware/App/Drivers/Battery.c =================================================================== diff -u -rbf44edd28c59df78a75165764b6b654f2e91e556 -re7c4a51e6057f0cc83fabc72f2df9bb5dffee391 --- firmware/App/Drivers/Battery.c (.../Battery.c) (revision bf44edd28c59df78a75165764b6b654f2e91e556) +++ firmware/App/Drivers/Battery.c (.../Battery.c) (revision e7c4a51e6057f0cc83fabc72f2df9bb5dffee391) @@ -221,27 +221,6 @@ /*********************************************************************//** * @brief - * The isACPowerLost function determines whether A/C power loss has been - * detected. - * @details Inputs: none - * @details Outputs: none - * @return TRUE if A/C power loss condition is in effect, FALSE if not - *************************************************************************/ -BOOL isACPowerLost( void ) -{ - BOOL result = TRUE; - - if ( ( FALSE == isAlarmConditionDetected( ALARM_ID_HD_AC_POWER_LOST ) ) && - ( FALSE == isAlarmConditionDetected( ALARM_ID_HD_AC_POWER_LOST_IN_TREATMENT ) ) ) - { - result = FALSE; - } - - return result; -} - -/*********************************************************************//** - * @brief * The getI2CStatusRegister function returns the I2C status register * @details Inputs: batteryI2CStatusRegister, i2cREG1->STR * @details Outputs: none Index: firmware/App/Drivers/Battery.h =================================================================== diff -u -raa8b9687b9396b4878cf0d5327d72a5d67477761 -re7c4a51e6057f0cc83fabc72f2df9bb5dffee391 --- firmware/App/Drivers/Battery.h (.../Battery.h) (revision aa8b9687b9396b4878cf0d5327d72a5d67477761) +++ firmware/App/Drivers/Battery.h (.../Battery.h) (revision e7c4a51e6057f0cc83fabc72f2df9bb5dffee391) @@ -78,7 +78,6 @@ void execBatteryMonitor( void ); BOOL isBatteryCharged( void ); -BOOL isACPowerLost( void ); BOOL testSetBatteryRemainingCapacityOverride( F32 value ); BOOL testResetBatteryRemainingCapacityOverride( void );