123456789101112131415161718192021222324252627282930313233 |
- #include "tasks.h"
- #include "usart.h"
- void Report_To_AuxMCU_Process(void)
- {
- static uint32_t DelayTimeCnt = 0;
- static uint8_t battery_delay_flag = 0;
- uint8_t send_buffer[4];
- uint8_t mode;
- uint16_t soc;
-
- if(battery_delay_flag == 0)
- {
- DelayTimeCnt = SysTime_5ms;
- battery_delay_flag = 1;
- }
-
- if(TimeCntDiff_5ms(DelayTimeCnt) >= 40)//40 * 5 = 200 ms
- {
- mode = 0x0C; //0x11:read£¬0x16:write£¬0x0C:report
- /* Battery information command word */
- send_buffer[0] = 0x33;
- send_buffer[1] = 0x02;
- /* Battery information data */
- // send_buffer[2] = (BMS_RunInfo.SOC) & 0xFF;
- send_buffer[2] = soc & 0xFF;
- send_buffer[3] = BMS_RunInfo.Status.Status;
- /* Send data */
- SendCmdData(mode, send_buffer, 4);
- /* Clear timing flag */
- battery_delay_flag = 0;
- }
- }
|