Commit 93f0c3b0 authored by 张金硕's avatar 张金硕

🐞 fix:里程服务函数初始化完成后调用

parent 4f6ead50
......@@ -25,7 +25,7 @@ static void Data_User_EEPROM_Write(Data_EEPROM_Enum_t BlockID, uint32_t u32Data[
#define EEPROM_BLOCK_05 0xC0
#define EEPROM_BLOCK_06 0xE0
uint32_t Milleage_InitFlag = 0U;
/******************************************************************************
......@@ -41,6 +41,7 @@ void Data_User_Mileage_KL30Init(void)
Mileage_Func_t Func = {0};
ODO_Init_t ODOInit = {0};
Trip_Init_t TripInit[4] = {0};
Milleage_InitFlag = 0U;
(void)Data_User_EEPROM_Read(EM_MILEAGE_BLOCK, TempBuf, 1);
if (TempBuf[0] == 0xFFFFFFFF)
......@@ -112,11 +113,14 @@ void Data_User_Mileage_KL30Init(void)
// TripInit[EM_TRIP_D].IsRestart = 1u;
Data_Trip_KL30_Init(DataTripBuf, TripInit, EM_TRIP_MAX, Func.EEPromWrite_Cbk);
Milleage_InitFlag = 0X5AA53AA3UL;
}
void Data_User_Mileage_WakeupInit(void)
{
Mileage_Func_t Func = {0};
Milleage_InitFlag = 0;
Func.Get_Sys_IG_Sts = Common_Get_IG_Sts;
Func.Get_Act_V_Speed_Valid = Common_Get_Act_V_Speed_Valid;
......@@ -128,9 +132,14 @@ void Data_User_Mileage_WakeupInit(void)
Data_ODO_Wakeup_Init(DataODOBuf, Func.EEPromWrite_Cbk);
Data_Trip_Wakeup_Init(DataTripBuf, EM_TRIP_MAX, Func.EEPromWrite_Cbk);
Milleage_InitFlag = 0X5AA53AA3UL;
}
uint32_t Get_MileageInit_Status(void)
{
return Milleage_InitFlag;
}
static uint32_t Data_User_EEPROM_Read(uint16_t u16BlockID, uint32_t u32Data[], uint16_t u16Len)
{
......
......@@ -114,18 +114,22 @@ void Sys_Exact_50us_Tasks(void)
if(task_100ms >= 2000U)
{
task_100ms = 0U;
Data_Mileage_ISR();
if(Get_MileageInit_Status() == 0X5AA53AA3UL)
{
Data_Mileage_ISR();
}
}
// if(g_u8GPIOTurnOver)
// {
// PORT->PM13 &= ~(1<<0);
// PORT->PSET13 = (1<<0);
// g_u8GPIOTurnOver = 0U;
// PORT->PM0 &= ~(1<<3);
// PORT->PSET0 = (1<<3);
// g_u8GPIOTurnOver = 0U;
// Gen_TimeDelay(10000u, 50u);
// }
// else
// {
// PORT->PM13 &= ~(1<<0);
// PORT->PCLR13 = (1<<0);
// g_u8GPIOTurnOver = 1U;
// PORT->PM0 &= ~(1<<3);
// PORT->PCLR0 = (1<<3);
// g_u8GPIOTurnOver = 1U;
// }
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment