Index: firmware/App/Drivers/Battery.c =================================================================== diff -u -re319bb5b8fd8a5320c0bb30986764f9b8f3c0814 -r54dfd4afd2624699d3507c1e90a84f3444ad25c4 --- firmware/App/Drivers/Battery.c (.../Battery.c) (revision e319bb5b8fd8a5320c0bb30986764f9b8f3c0814) +++ firmware/App/Drivers/Battery.c (.../Battery.c) (revision 54dfd4afd2624699d3507c1e90a84f3444ad25c4) @@ -40,7 +40,7 @@ #define BATTERY_COMM_TIME_OUT_MS 2 ///< Battery communication time out in ms. #define BATTERY_MONITOR_INTERVAL_MS 250 ///< Battery monitor interval in ms. -//#define BATTERY_MONITOR_INTERVAL_MS 10000 ///< Battery monitor interval in ms. - TODO+ Remove for TEST ONLY DN-30SEPT2022 + #define AC_POWER_LOST_PERSISTENT_COUNT 3 ///< AC power lost persistent count before alarming. #define BATTERY_COMM_FAULT_PERSISTENTCE_COUNT 5 ///< Battery communication fault persistent count before alarming. @@ -450,12 +450,14 @@ return result; } - /*********************************************************************//** * @brief - * The getBatteryManagementData function accumulates the battery management data and publishes when complete - * @details Inputs: - * @details Outputs: + * The getBatteryManagementData function accumulates the battery management and status data and + * publishes the two sets of values when complete. Also, the battery remaining capacity is stored, + * the battery status alarm is set if necessary, and the loss of AC power alarm is set if necessary. + * @details Inputs: current_BM_value determines which single value to read + * @details Outputs: batteryRemCapacity_mAh, publishes battery management data and battery status data, + * battery status alarm, AC power loss alarm. * @return none *************************************************************************/ static void getBatteryManagementData(void) @@ -641,13 +643,10 @@ } - - - /*********************************************************************//** * @brief - * The publishBatteryManagementData function publishes the accumulated battery management data - * @details Inputs: + * The publishBatteryManagementData function publishes the battery management data + * @details Inputs: BatteryManagerData * @details Outputs: send battery management data * @return none *************************************************************************/ @@ -659,7 +658,7 @@ /*********************************************************************//** * @brief * The publishBatteryStatusData function publishes the battery status data - * @details Inputs: + * @details Inputs: BatteryStatusData * @details Outputs: send battery status data * @return none *************************************************************************/ @@ -668,6 +667,8 @@ BatteryStatusData.RemainingCapacity = (U32)getBatteryRemainingCapacity_mWh(); broadcastData( MSG_ID_HD_BATTERY_STATUS_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&BatteryStatusData, sizeof( BATTERY_STATUS_PAYLOAD_T ) ); } + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/