123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- #include <BBox_Bcu.h>
- static process_Rte gProcess_Rte_Task;
- #define PROC_RTE_STATE_SWITCH(a) (gProcess_Rte_Task = a)
- //=========================================================================
- //=========================================================================
- //=========================================================================
- void BBox_BCU_Task(void *pvParameters)
- {
- uint16_T i;
- uint16_T RecvCounter = 0;
- static boolean_T Flg;
- //鍚姩寤惰繜娌″仛
- PROC_RTE_STATE_SWITCH(PROCESS_STATE_INIT);
- while (TRUE)
- {
- switch (gProcess_Rte_Task)
- {
- //=========================鍒濆鍖�===============================
- case PROCESS_STATE_INIT:
- {
- BCU_initialize();
- BCUEEDataRead();
- PROC_RTE_STATE_SWITCH(PROCESS_STATE_WORK);
- break;
- }
- //============================宸ヤ綔妯″紡==========================
- case PROCESS_STATE_WORK:
- {
- if (TimerCounter % 100 == 0)
- {
- IH_Data_Update();
- /*
- bswv_V_cellU = 0;
- bswv_T_modT = 0;
- bswd_tm_month = 0;
- bswd_tm_day = 0;
- bswd_tm_hour = 0;
- bswd_tm_min = 0;
- bswd_tm_sec = 0;
- bswd_tm_year = 0;
- hvmd_st_operMod_T1 = 0;
- dcmd_st_chrgMod_T1 = 0;
- dcmd_st_chrgSts_T1 = 0;
- ihd_I_battCurr_T1 = 0;
- ihd_V_battU_T1 = 0;
- */
- // Dio_WriteChannel(DioConf_DioChannel_PTE7_GPIO_OUT_MCU_LED3, STD_OFF);
- // BCU_step();
- //
- if (socd_flg_EEsave == 1)
- {
- BCUEEDataSave();
- }
- // Dio_WriteChannel(DioConf_DioChannel_PTE7_GPIO_OUT_MCU_LED3, STD_ON);
- OH_Data_Update();
- }
- vTaskDelay(pdMS_TO_TICKS(10));
- break;
- }
- default:
- {
- PROC_RTE_STATE_SWITCH(PROCESS_STATE_INIT);
- break;
- }
- }
- }
- }
- //=========================鏁版嵁瀛樺偍========================================
- void BCUEEDataRead(void)
- {
- memset(rtev_flg_EESt, 0, sizeof(rtev_flg_EESt));
- //时间
- ihd_tm_yearEi = BcuAppSaveDataInfo.ihd_tm_yearE;
- ihd_tm_monthEi = BcuAppSaveDataInfo.ihd_tm_monthE;
- ihd_tm_dayEi = BcuAppSaveDataInfo.ihd_tm_dayE;
- ihd_tm_hourEi = BcuAppSaveDataInfo.ihd_tm_hourE;
- ihd_tm_minEi = BcuAppSaveDataInfo.ihd_tm_minE;
- ihd_tm_secEi = BcuAppSaveDataInfo.ihd_tm_secE;
- //SOC
- socd_pct_bcuSocEi = BcuAppSaveDataInfo.socd_pct_bcuSocE;
- socd_pct_battSocEi = BcuAppSaveDataInfo.socd_pct_battSocE;
- /*/SOH
- sohd_flg_countEi = BcuAppSaveDataInfo.sohd_flg_countE;
- sohd_Q_chrgEi = BcuAppSaveDataInfo.sohd_Q_chrgE;
- memcpy(sohv_Q_cellCapEi, BcuAppSaveDataInfo.sohv_Q_cellCapE, sizeof(sohv_Q_cellCapEi));
- memcpy(sohv_V_cellUEi, BcuAppSaveDataInfo.sohv_V_cellUE, sizeof(sohv_V_cellUEi));
- memcpy(sohv_Q_packCapEi, BcuAppSaveDataInfo.sohv_Q_packCapE, sizeof(sohv_Q_packCapEi));
- //SOR
- memcpy(sorv_ohm_cellREi, BcuAppSaveDataInfo.sorv_ohm_cellRE, sizeof(sorv_ohm_cellREi));
- //BLC
- memcpy(blcv_Q_totalCpEi, BcuAppSaveDataInfo.blcv_Q_totalCpE, sizeof(blcv_Q_totalCpEi));
- memcpy(blcv_Q_reqCpEi, BcuAppSaveDataInfo.blcv_Q_reqCpE, sizeof(blcv_Q_reqCpEi));
- //ISC
- iscd_tm_chrgEi = BcuAppSaveDataInfo.iscd_tm_chrgE;
- iscd_tm_staticEi = BcuAppSaveDataInfo.iscd_tm_staticE;
- memcpy(iscv_ohm_chrgEi, BcuAppSaveDataInfo.iscv_ohm_chrgE, sizeof(iscv_ohm_chrgEi));
- memcpy(iscv_ohm_staticEi, BcuAppSaveDataInfo.iscv_ohm_staticE, sizeof(iscv_ohm_staticEi));
- memcpy(iscv_Q_chrgEi, BcuAppSaveDataInfo.iscv_Q_chrgE, sizeof(iscv_Q_chrgEi));
- memcpy(iscv_Q_staticEi, BcuAppSaveDataInfo.iscv_Q_staticE, sizeof(iscv_Q_staticEi));
- *///DAM
- damd_Q_totalChrgCpEi = BcuAppSaveDataInfo.damd_Q_totalChrgCpE;
- damd_E_totalChrgEngEi = BcuAppSaveDataInfo.damd_E_totalChrgEngE;
- damd_Q_totalRegenCpEi = BcuAppSaveDataInfo.damd_Q_totalRegenCpE;
- damd_E_totalRegenEngEi = BcuAppSaveDataInfo.damd_E_totalRegenEngE;
- damd_Q_totalDisChrgCpEi = BcuAppSaveDataInfo.damd_Q_totalDisChrgCpE;
- damd_E_totalDisChrgEngEi = BcuAppSaveDataInfo.damd_E_totalDisChrgEngE;
- }
- void BCUEEDataSave(void)
- {
- BcuAppSaveDataInfo.bcuSaveFlg = TRUE;
- //
- BcuAppSaveDataInfo.ihd_tm_yearE = ihd_tm_yearEo;
- BcuAppSaveDataInfo.ihd_tm_monthE = ihd_tm_monthEo;
- BcuAppSaveDataInfo.ihd_tm_dayE = ihd_tm_dayEo;
- BcuAppSaveDataInfo.ihd_tm_hourE = ihd_tm_hourEo;
- BcuAppSaveDataInfo.ihd_tm_minE = ihd_tm_minEo;
- BcuAppSaveDataInfo.ihd_tm_secE = ihd_tm_secEo;
- //SOC
- BcuAppSaveDataInfo.socd_pct_bcuSocE = socd_pct_bcuSocEo;
- BcuAppSaveDataInfo.socd_pct_battSocE = socd_pct_battSocEo;
- /*/SOH
- BcuAppSaveDataInfo.sohd_flg_countE = sohd_flg_countEo;
- BcuAppSaveDataInfo.sohd_Q_chrgE = sohd_Q_chrgEo;
- memcpy(BcuAppSaveDataInfo.sohv_Q_cellCapE, sohv_Q_cellCapEo,sizeof(sohv_Q_cellCapEo));
- memcpy(BcuAppSaveDataInfo.sohv_V_cellUE,sohv_V_cellUEo, sizeof(sohv_V_cellUEo));
- memcpy(BcuAppSaveDataInfo.sohv_Q_packCapE,sohv_Q_packCapEo, sizeof(sohv_Q_packCapEo));
- //SOR
- memcpy(BcuAppSaveDataInfo.sorv_ohm_cellRE,sorv_ohm_cellREo, sizeof(sorv_ohm_cellREo));
- //BLC
- memcpy(BcuAppSaveDataInfo.blcv_Q_totalCpE, blcv_Q_totalCpEo,sizeof(blcv_Q_totalCpEo));
- memcpy(BcuAppSaveDataInfo.blcv_Q_reqCpE, blcv_Q_reqCpEo,sizeof(blcv_Q_reqCpEo));
- //ISC
- BcuAppSaveDataInfo.iscd_tm_chrgE = iscd_tm_chrgEo;
- BcuAppSaveDataInfo.iscd_tm_staticE = iscd_tm_staticEo;
- memcpy(BcuAppSaveDataInfo.iscv_ohm_chrgE, iscv_ohm_chrgEo,sizeof(iscv_ohm_chrgEo));
- memcpy(BcuAppSaveDataInfo.iscv_ohm_staticE, iscv_ohm_staticEo,sizeof(iscv_ohm_staticEo));
- memcpy(BcuAppSaveDataInfo.iscv_Q_chrgE, iscv_Q_chrgEo,sizeof(iscv_Q_chrgEo));
- memcpy(BcuAppSaveDataInfo.iscv_Q_staticE, iscv_Q_staticEo,sizeof(iscv_Q_staticEo));
- *///DAM
- BcuAppSaveDataInfo.damd_Q_totalChrgCpE = damd_Q_totalChrgCpEo;
- BcuAppSaveDataInfo.damd_E_totalChrgEngE = damd_E_totalChrgEngEo;
- BcuAppSaveDataInfo.damd_Q_totalRegenCpE = damd_Q_totalRegenCpEo;
- BcuAppSaveDataInfo.damd_E_totalRegenEngE = damd_E_totalRegenEngEo;
- BcuAppSaveDataInfo.damd_Q_totalDisChrgCpE = damd_Q_totalDisChrgCpEo;
- BcuAppSaveDataInfo.damd_E_totalDisChrgEngE = damd_E_totalDisChrgEngEo;
- }
|