forked from gary/BCU
2
0
Fork 0

提交测试

This commit is contained in:
guzz 2025-02-15 08:21:45 +08:00
parent de4f10aaf2
commit f02582475f
8 changed files with 2264248 additions and 194 deletions

View File

@ -103,7 +103,7 @@ void bmu_config_init(void)
drv_gpio_set_pin_status(kGpioType_SP1_Cs_En2, kGpioStatus_Low);
//drv_gpio_set_pin_status(kGpioType_SP1_Cs_En1, kGpioStatus_Low);
bmu_data.bmu_num = get_eeprom_data(kEep_DevAddr_SlaverNum, kEepromDataType_Low);
//bmu_data.bmu_num = 2;
//bmu_data.bmu_num = 1;
if (bmu_data.bmu_num > BMU_MAX_NUM || bmu_data.bmu_num == 0)
{
bmu_data.bmu_num = BMU_MAX_NUM;
@ -115,8 +115,8 @@ void bmu_config_init(void)
bmu_data.total_cell_num = get_eeprom_data(kEep_CellNum, kEepromDataType_Full);
bmu_data.total_temp_num = get_eeprom_data(kEep_TempNum, kEepromDataType_Full);
//bmu_data.total_cell_num = 32;
//bmu_data.total_temp_num = 18;
//bmu_data.total_cell_num = 16;
//bmu_data.total_temp_num = 8;
//set num from hmi =>adapt num for furture
cell_num = bmu_data.total_cell_num / bmu_data.bmu_num;
@ -241,6 +241,7 @@ void bmu_vlot_breakline_check()
}
static int tempJudge_cnt[26][9] = {0};
//static int tempCellErr_cnt = 0;
//@wkun the here can add temp line break or connect
void bmu_temp_breakline_check(int value, int bmuIdx, int tempIdx)
{
@ -445,6 +446,7 @@ void bms_poll_bmu(uint32_t base_time)
bmu_data_handler(base_time);
//温感检测是否脱落加上了防抖需要两次大于6000才设置温感排线错误温感排线错误显示的有点慢
//温感的值最开始全是大于6000的第二次才是采集值
memset(tempJudge_cnt, 0, sizeof(tempJudge_cnt));
//2-5 @wangk add this line bcu statistic data is show
bms_poll_statistic(0);

View File

@ -20,6 +20,9 @@ extern "C" {
#include "statistic_manager.h"
#include "run_status.h"
#include "logic_ctrl.h"
#include "bmu_manager.h"
#include "string.h"
#include "stdio.h"
typedef struct
{

View File

@ -372,7 +372,7 @@ void soc_exterme_calibrate(int16_t current, uint16_t base_time)
if (((bms_get_statistic_data(kStatisticData_MinVolt) <= get_eeprom_data(kEep_FullDisVolt, kEepromDataType_Full))
&& (avg_volt <= get_eeprom_data(kEep_FullDisAvgVolt, kEepromDataType_Full))
&& (bms_get_ex_data(kExType_CellVolt) == kExStatus_None))
|| (total_volt <= get_eeprom_data(kEep_FullDisTotalVolt, kEepromDataType_Full))
|| (total_volt <= get_eeprom_data(kEep_FullDisTotalVolt, kEepromDataType_Full)/100)
|| ((sox_item.soc_req_st == kSocStatus_Empty) && (sox_item.is_bsu_adjust == false)))
{
full_dly = 0;
@ -465,8 +465,8 @@ void bms_init_soc(void)
uint64_t tmp_64u;
int32_t year, mon, day;
soc = get_eeprom_data(kEep_SOC, kEepromDataType_Full);
//soc = bms_check_pwr_on_ocv(soc);
//soc = get_eeprom_data(kEep_SOC, kEepromDataType_Full);
soc = bms_check_pwr_on_ocv(soc);
sox_item.soc_kEep_99 = true;
sox_item.soc_kEep_1 = true;
if (soc == 0)

View File

@ -59,7 +59,8 @@ void task_100ms_handler(uint32_t base_time)
static uint32_t cout100ms = 0;
cout100ms++;
bms_poll_iso(base_time);
//bms_poll_adc(base_time);
//bms_poll_adc(); THis was originally commented.
bms_poll_adc(base_time);
bms_poll_statistic(base_time);
bms_poll_run_status(base_time);
bms_poll_sop(base_time);
@ -99,6 +100,7 @@ void poll_1ms_task_init(void)
bms_init_gpio();
bms_init_eeprom();
//bms_init_adc(); THis was originally commented.
//bms_init_adc();
bms_init_tag();
bms_init_run();
@ -148,7 +150,8 @@ void poll_10ms_task_init(void)
drv_misc_cfg_pwr_off_interrupt(APP_CFG_INT_PRIO_PWR_OFF, kPwrOffVolt_2_9, bms_pwr_off_save);
KIT_SET_BIT_MASK_32(is_data_ok, BMU_FINISH_BIT);
//while(KIT_GET_BIT_32(is_data_ok, SIGNAL_FINISH_BIT) == 0)
//next line is originally commented.
while(KIT_GET_BIT_32(is_data_ok, SIGNAL_FINISH_BIT) == 0)
{
bsp_task_delay_ms(10);
}
@ -158,7 +161,8 @@ void poll_10ms_task_init(void)
bms_init_sop();
bms_init_iso();
//bsp_create_task(&poll_100ms_task, (uint8_t *)"100ms");
//bsp_create_task(&poll_100ms_task, (uint8_t *)"100ms");,THis was originally commented.
bsp_create_task(&poll_100ms_task, (uint8_t *)"100ms");
bsp_create_task(&bms_poll_bmu_task, (uint8_t *)"100ms");
bsp_create_task(&ord_comm_can_task, (uint8_t *)"100ms");
bsp_create_task(&modbus_rtu_task1, (uint8_t *)"inter_modbus");

File diff suppressed because one or more lines are too long

View File

@ -786,6 +786,11 @@
<FileType>1</FileType>
<FilePath>..\app\fault_manager.c</FilePath>
</File>
<File>
<FileName>ocv_tables.c</FileName>
<FileType>1</FileType>
<FilePath>..\app\ocv_tables.c</FilePath>
</File>
<File>
<FileName>fault_register.c</FileName>
<FileType>1</FileType>
@ -831,11 +836,6 @@
<FileType>1</FileType>
<FilePath>..\app\logic_same_circuit_ctrl.c</FilePath>
</File>
<File>
<FileName>ocv_tables.c</FileName>
<FileType>1</FileType>
<FilePath>..\app\ocv_tables.c</FilePath>
</File>
<File>
<FileName>run_status.c</FileName>
<FileType>1</FileType>
@ -1743,6 +1743,11 @@
<FileType>1</FileType>
<FilePath>..\app\fault_manager.c</FilePath>
</File>
<File>
<FileName>ocv_tables.c</FileName>
<FileType>1</FileType>
<FilePath>..\app\ocv_tables.c</FilePath>
</File>
<File>
<FileName>fault_register.c</FileName>
<FileType>1</FileType>
@ -1788,11 +1793,6 @@
<FileType>1</FileType>
<FilePath>..\app\logic_same_circuit_ctrl.c</FilePath>
</File>
<File>
<FileName>ocv_tables.c</FileName>
<FileType>1</FileType>
<FilePath>..\app\ocv_tables.c</FilePath>
</File>
<File>
<FileName>run_status.c</FileName>
<FileType>1</FileType>

File diff suppressed because it is too large Load Diff