Sys_Task_List.c 2.04 KB
Newer Older
时昊's avatar
时昊 committed
1 2 3 4 5

#include "Sys_Scheduler_Lib.h"
#include "Components.h"
//#include "CommonInterface.h"
#include "RTE.h"
6 7
extern RTC_CounterTypeDef counter_val;
extern _Menu_Data MenuData;
时昊's avatar
时昊 committed
8 9 10 11 12 13 14 15 16 17 18

void Sys_Pseudo_Real_Time_Tasks(void)
{
    Power_Management_Service();
}

void Sys_2ms_Tasks(void)
{
    Common_Input_Para();
    Sys_Status_Update_Service();
    Analog_Signal_Conv_Service();
19
    AMT630H_Main();
时昊's avatar
时昊 committed
20
    Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);
21
    CanMSg_XMS_Analysis(&CAN_CH0_CanMsgOp, 2u);
时昊's avatar
时昊 committed
22 23 24 25 26 27 28 29 30
}

void Sys_5ms_Tasks(void)
{
    Flash_Sync_Signal_Generation_Service();
}

void Sys_10ms_Tasks(void)
{
时昊's avatar
时昊 committed
31
    Line_In_Debounce_Service(10u);
时昊's avatar
时昊 committed
32
    Key_Service();
33
    Data_Mileage_Write_EEPROM();
时昊's avatar
时昊 committed
34 35
    Key_Clear_Time();
    Key_TimeOut_Service();
时昊's avatar
时昊 committed
36
    Fuel_R_Cal(10u);
37
    Coolant_R_Cal(10u);
时昊's avatar
时昊 committed
38 39 40 41
}

void Sys_20ms_Tasks(void)
{
42 43
    Data_Vehicle_Speed_Processing_Service();
    Data_Engine_Speed_Processing_Service();
时昊's avatar
时昊 committed
44 45 46 47
}

void Sys_50ms_Tasks(void)
{
时昊's avatar
时昊 committed
48
    Telltales_Management();
时昊's avatar
时昊 committed
49
    g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information();
50 51 52 53 54 55 56 57 58 59 60 61 62


    if((MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit) > 23)
    {
        MenuData.Dis_Hour_Tenb = 2;
        MenuData.Dis_Hour_Bit = 3;
    }

    if((MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit) > 59)
    {
        MenuData.Dis_Minute_Tenb = 5;
        MenuData.Dis_Minute_Bit = 9;
    }
时昊's avatar
时昊 committed
63 64
}

65 66
uint32_t ODOtest = 0;
uint32_t Triptest = 0;
67 68
uint32_t aaa = 0;

时昊's avatar
时昊 committed
69 70
void Sys_100ms_Tasks(void)
{
71 72
    ODOtest = Data_ODO_Read();
    Triptest = Data_Read_Trip(0);
73
    Get_DisTime_Service();
时昊's avatar
时昊 committed
74
    Fuel_Cal_Sevice(100u);
75
    Coolant_Cal_Sevice(100u);
76
    Services_Mileage_Callback();
77

78 79 80
    RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High);

    // aaa = Menu_Item_Select_Get(MENU_ITEM_SELECT_AUTO);
时昊's avatar
时昊 committed
81
}
82
static uint16_t task_2ms = 0u;
时昊's avatar
时昊 committed
83 84 85 86 87 88 89 90 91 92 93
void Sys_Exact_50us_Tasks(void)
{
    static uint32_t task_1ms = 0u;
    GenDelay_Tick();
    ////DoCAN_Timer_Update(50u);
    task_1ms++;
    if ( task_1ms >=20U )   
    {
        task_1ms =0U;
        eeprom_1ms_timeCount( );
    }
94 95 96 97 98 99 100

    task_2ms++;
    if (task_2ms >= 40)
    {
        task_2ms = 0;        
        AMT630H_Timer(2);
    }
时昊's avatar
时昊 committed
101
}