Sys_Task_List.c 2.38 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
#include "UDS_ISO14229_Server.h"
7
#include "FaultCode.h"
8
extern _Menu_Data MenuData;
时昊's avatar
时昊 committed
9 10 11 12

void Sys_Pseudo_Real_Time_Tasks(void)
{
    Power_Management_Service();
13 14
    DoCAN_Communication_Service();
    UDS_Server_Application_Service();
时昊's avatar
时昊 committed
15 16 17 18 19 20 21
}

void Sys_2ms_Tasks(void)
{
    Common_Input_Para();
    Sys_Status_Update_Service();
    Analog_Signal_Conv_Service();
22
    AMT630H_Main();
23
    Check_MCU_Info_in_630H(); 
24
    DoCAN_Timer_Update(2000u);
时昊's avatar
时昊 committed
25
    //Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);无外发
26
    CanMSg_XMS_Analysis(&CAN_CH0_CanMsgOp, 2u);
时昊's avatar
时昊 committed
27 28 29 30 31 32 33 34 35
}

void Sys_5ms_Tasks(void)
{
    Flash_Sync_Signal_Generation_Service();
}

void Sys_10ms_Tasks(void)
{
36
    FaultCode_Service(10u);
时昊's avatar
时昊 committed
37
    Line_In_Debounce_Service(10u);
时昊's avatar
时昊 committed
38
    Key_Service();
39
    Data_Mileage_Write_EEPROM();
时昊's avatar
时昊 committed
40 41
    Key_Clear_Time();
    Key_TimeOut_Service();
时昊's avatar
时昊 committed
42
    Fuel_R_Cal(10u);
43
    Coolant_R_Cal(10u);
44
    Data_Light_Res_service(10);
时昊's avatar
时昊 committed
45 46 47 48
}

void Sys_20ms_Tasks(void)
{
49 50
    Data_Vehicle_Speed_Processing_Service();
    Data_Engine_Speed_Processing_Service();
时昊's avatar
时昊 committed
51 52 53 54
}

void Sys_50ms_Tasks(void)
{
55
    BackLight_Service();
时昊's avatar
时昊 committed
56
    Telltales_Management();
时昊's avatar
时昊 committed
57
    g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information();
58 59


60 61 62
    if((MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit) > 23)
    {
        MenuData.Dis_Hour_Tenb = 2;
63
        MenuData.Dis_Hour_Bit = 0;
64
    }
65

66 67 68 69 70
    if((MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit) > 59)
    {
        MenuData.Dis_Minute_Tenb = 5;
        MenuData.Dis_Minute_Bit = 9;
    }
时昊's avatar
时昊 committed
71 72
}

73 74
uint32_t ODOtest = 0;
uint32_t Triptest = 0;
75 76
uint32_t aaa = 0;

时昊's avatar
时昊 committed
77 78
void Sys_100ms_Tasks(void)
{
79
    BlueToothService();
80
    S3_ServerCNTT();
81
    Get_DisTime_Service();
时昊's avatar
时昊 committed
82
    Fuel_Cal_Sevice(100u);
83
    Coolant_Cal_Sevice(100u);
84
    Services_Mileage_Callback();
85
    // Data_Mileage_Clear();
86
    RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High);
87
    //BackLight_Process();
88
    //TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 100);
89 90

    // aaa = Menu_Item_Select_Get(MENU_ITEM_SELECT_AUTO);
时昊's avatar
时昊 committed
91
}
92
static uint16_t task_2ms = 0u;
时昊's avatar
时昊 committed
93 94 95 96 97 98 99 100 101 102 103
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( );
    }
104 105 106 107 108 109 110

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