Index: firmware/App/Drivers/Battery.c =================================================================== diff -u -r54dfd4afd2624699d3507c1e90a84f3444ad25c4 -re9e80b33a004bdc3eaa83e4a916b4cf225e3d201 --- firmware/App/Drivers/Battery.c (.../Battery.c) (revision 54dfd4afd2624699d3507c1e90a84f3444ad25c4) +++ firmware/App/Drivers/Battery.c (.../Battery.c) (revision e9e80b33a004bdc3eaa83e4a916b4cf225e3d201) @@ -39,7 +39,7 @@ #define BATTERY_PACK_MIN_CHARGE_PCT 50 ///< Minimum battery pack state of charge in percentage. #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 /* 250 */ 1000 ///< Battery monitor interval in ms. - DN-10OCT2022 TODO Restore 250 #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. @@ -390,9 +390,9 @@ generateStopCondition(); if ( ++commFaultPersistentCount > BATTERY_COMM_FAULT_PERSISTENTCE_COUNT ) { -#ifndef DISABLE_BATT_COMM +//#ifndef DISABLE_BATT_COMM - DN-10OCT2022 TODO: Uncomment this SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_BATTERY_COMM_FAULT, slaveAddr ); -#endif +//#endif } } } @@ -446,6 +446,19 @@ } } } + // Test code for battery "bus collision" issue - DN-10OCT2022: TODO: Keep or remove this test code? + // BEGIN + if ( FALSE == result ) + { + if ( ++commFaultPersistentCount > BATTERY_COMM_FAULT_PERSISTENTCE_COUNT ) + { +//#ifndef DISABLE_BATT_COMM - DN-10OCT2022 TODO: Uncomment this + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_BATTERY_COMM_FAULT, dataPtr ); +//#endif + commFaultPersistentCount = 0; + } + } + // END return result; } Index: firmware/App/Tasks/TaskBG.c =================================================================== diff -u -r46b163d19c65e8c21db7b0247bbb1af0dba1ece5 -re9e80b33a004bdc3eaa83e4a916b4cf225e3d201 --- firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision 46b163d19c65e8c21db7b0247bbb1af0dba1ece5) +++ firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision e9e80b33a004bdc3eaa83e4a916b4cf225e3d201) @@ -50,7 +50,8 @@ * @return none *************************************************************************/ void taskBackground( void ) -{ +{ + startUICommTimeout = getMSTimerCount(); #ifndef _VECTORCAST_ // Cannot have infinite loop in unit test tool