Commit 7ff1da3e authored by 陈家乐's avatar 陈家乐

🐞 fix:里程累积放在100ms中断里执行

parent 10a64715
...@@ -45,7 +45,7 @@ uint16_t Common_Get_Act_V_Speed(void) ...@@ -45,7 +45,7 @@ uint16_t Common_Get_Act_V_Speed(void)
} }
uint16_t Common_Get_Act_V_Speed_ODO(void) uint16_t Common_Get_Act_V_Speed_ODO(void)
{ {
return Act_V_Speed * 101 / 100; return Act_V_Speed;// * 101 / 100;
} }
uint16_t Common_Get_Disp_V_Speed(void) uint16_t Common_Get_Disp_V_Speed(void)
{ {
......
...@@ -220,7 +220,7 @@ uint32_t Get_MileageInit_Status(void) ...@@ -220,7 +220,7 @@ uint32_t Get_MileageInit_Status(void)
void Services_Mileage_Callback(void) void Services_Mileage_Callback(void)
{ {
Data_Mileage_ISR(); //Data_Mileage_ISR();
Data_ODO_Processing(); Data_ODO_Processing();
Data_Trip_Processing(); Data_Trip_Processing();
//Trip_Clear_Km_Service(); //Trip_Clear_Km_Service();
......
...@@ -131,9 +131,15 @@ void Sys_100ms_Tasks(void) ...@@ -131,9 +131,15 @@ void Sys_100ms_Tasks(void)
void Sys_Exact_50us_Tasks(void) void Sys_Exact_50us_Tasks(void)
{ {
static uint32_t task_1ms = 0u; static uint32_t task_1ms = 0u;
static uint32_t task_100ms = 0u;
Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 50u); Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 50u);
DoCAN_Timer_Update(50u); DoCAN_Timer_Update(50u);
GenDelay_Tick(); GenDelay_Tick();
task_100ms++;
if(task_100ms >= 2000)
{
Data_Mileage_ISR();
}
task_1ms++; task_1ms++;
if ( task_1ms >=20U ) if ( task_1ms >=20U )
{ {
......
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