forked from gary/BCU
2
0
Fork 0

高压堆叠程序,除wifi外基本OK

This commit is contained in:
guzz 2025-04-27 16:06:36 +08:00
parent ea635ee7b6
commit e62cd7941a
4 changed files with 6373 additions and 665 deletions

View File

@ -951,26 +951,26 @@ void bms_init_eeprom(void)
void bms_pwr_off_save(void)
{
uint32_t i, cnt = 0, tmp_32u;
EepromPoData data[30];
tmp_32u = bms_get_cycle_flag() | (bms_get_stat_day() << 8);
data[cnt++].value = (kEep_StatDay_CycleTimesFlag << 16) | ((uint16_t)tmp_32u);
EepromPoData data[8];
// tmp_32u = bms_get_cycle_flag() | (bms_get_stat_day() << 8);
// data[cnt++].value = (kEep_StatDay_CycleTimesFlag << 16) | ((uint16_t)tmp_32u);
data[cnt++].value = (kEep_SOC << 16) | ((uint16_t)bms_get_soc());
data[cnt++].value = (kEep_SOE << 16) | ((uint16_t)bms_get_soc());
data[cnt++].value = (kEep_CycleTimes << 16) | ((uint16_t)bms_get_cycle());
tmp_32u = drv_rtc_get_tick();
data[cnt++].value = (kEep_PowerOffTimeL << 16) | ((uint16_t)tmp_32u);
data[cnt++].value = (kEep_PowerOffTimeH << 16) | ((uint16_t)(tmp_32u >> 16));
tmp_32u = bms_get_cumulate_data(kCumulateData_DayDisTime);
tmp_32u |= bms_get_cumulate_data(kCumulateData_DayChgTime) << 8;
data[cnt++].value = (kEep_DayChg_DisTime << 16) | ((uint16_t)tmp_32u);
for(i = 0; i < 10; i++)
// data[cnt++].value = (kEep_SOE << 16) | ((uint16_t)bms_get_soc());
// data[cnt++].value = (kEep_CycleTimes << 16) | ((uint16_t)bms_get_cycle());
// tmp_32u = drv_rtc_get_tick();
// data[cnt++].value = (kEep_PowerOffTimeL << 16) | ((uint16_t)tmp_32u);
// data[cnt++].value = (kEep_PowerOffTimeH << 16) | ((uint16_t)(tmp_32u >> 16));
//
// tmp_32u = bms_get_cumulate_data(kCumulateData_DayDisTime);
// tmp_32u |= bms_get_cumulate_data(kCumulateData_DayChgTime) << 8;
// data[cnt++].value = (kEep_DayChg_DisTime << 16) | ((uint16_t)tmp_32u);
for(i = 0; i < 6; i++)
{
tmp_32u = bms_get_cumulate_data((CumulateData)(kCumulateData_DayDisCap + i));
data[cnt++].value = ((kEep_DayDisCapL + (i << 1)) << 16) | (uint16_t)tmp_32u;
data[cnt++].value = ((kEep_DayDisCapH + (i << 1)) << 16) | (uint16_t)(tmp_32u >> 16);
tmp_32u = bms_get_cumulate_data((CumulateData)(kCumulateData_AccDisTime + i));
data[cnt++].value = ((kEep_AccDisTimeL + (i << 1)) << 16) | (uint16_t)tmp_32u;
data[cnt++].value = ((kEep_AccDisTimeH + (i << 1)) << 16) | (uint16_t)(tmp_32u >> 16);
}
data[cnt++].value = (kEep_IsSoftReset << 16) | 0;
// data[cnt++].value = (kEep_IsSoftReset << 16) | 0;
bsp_eeprom_power_off_save_data(data, cnt);
}

File diff suppressed because one or more lines are too long

View File

@ -10,15 +10,15 @@
<TargetName>stm32f407</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pArmCC>5050106::V5.05 update 1 (build 106)::ARMCC</pArmCC>
<pCCUsed>5050106::V5.05 update 1 (build 106)::ARMCC</pCCUsed>
<pArmCC>5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7</pArmCC>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F407ZGTx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F4xx_DFP.2.16.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<PackID>Keil.STM32F4xx_DFP.3.0.0</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00020000) IRAM2(0x10000000,0x00010000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>

File diff suppressed because it is too large Load Diff