Index: firmware/App/Drivers/Battery.c =================================================================== diff -u -ra053cecf0673654e2bc03e9a34ff15845c8cff93 -r364631fbb6ffd3ab52271e1cc5b71ee9e2cc777f --- firmware/App/Drivers/Battery.c (.../Battery.c) (revision a053cecf0673654e2bc03e9a34ff15845c8cff93) +++ firmware/App/Drivers/Battery.c (.../Battery.c) (revision 364631fbb6ffd3ab52271e1cc5b71ee9e2cc777f) @@ -213,6 +213,27 @@ /*********************************************************************//** * @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 getBatteryRemainingCapacity_mWh function returns the latest battery * remaining capacity (in mWh). * @details Inputs: batteryRemCapacity_mWh @@ -623,7 +644,7 @@ if ( 0 == ( BatteryStatusData.BatteryChargerStatus & BATTERY_CHARGER_STATUS_AC_PRESENT_MASK ) ) { // Pre-Treatment, Treatment, or Post-Treatment mode - if( opMode == MODE_PRET || opMode == MODE_TREA || opMode == MODE_POST ) + if ( opMode == MODE_PRET || opMode == MODE_TREA || opMode == MODE_POST ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_AC_POWER_LOST_IN_TREATMENT, BatteryStatusData.BatteryChargerStatus ); } @@ -636,6 +657,7 @@ else { clearAlarmCondition( ALARM_ID_HD_AC_POWER_LOST ); + clearAlarmCondition( ALARM_ID_HD_AC_POWER_LOST_IN_TREATMENT ); } } // Publish battery status data after reading battery charger status (last status read)