Index: firmware/App/Drivers/Battery.c =================================================================== diff -u -r0a4dcd288d4347b85baaa0b07da568b6add5eac7 -r88868fb5e8f2fcc82f50a952be700863f3cbe19c --- firmware/App/Drivers/Battery.c (.../Battery.c) (revision 0a4dcd288d4347b85baaa0b07da568b6add5eac7) +++ firmware/App/Drivers/Battery.c (.../Battery.c) (revision 88868fb5e8f2fcc82f50a952be700863f3cbe19c) @@ -212,6 +212,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 @@ -622,7 +643,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 ); } @@ -635,6 +656,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)