GUI_Display.c 3.28 KB
Newer Older
李俭双's avatar
李俭双 committed
1 2 3
#include "GUI_Display\GUI_Display.h"
#include "SEG_DISPLAY\SEG_DISPLAY.h" 
#include "Application.h"
李俭双's avatar
李俭双 committed
4

李俭双's avatar
李俭双 committed
5 6 7 8 9 10 11
void Gauge_Clock_Display(void)
{
    uint8_t PageType_DIS = 0;
    if (Common_Get_IG_Sts( ) == COMMON_POWER_ON)
    {
        PageType_DIS = Get_Current_PageType();

李俭双's avatar
李俭双 committed
12
        LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_ON);
李俭双's avatar
李俭双 committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
        
        if ( PageType_DIS == 1 )
        {
            if(FLASH_SYNC_1Hz)
            {
                SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 1, 1);
            }
            else
            {
                SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 0, 1);
            }
            
        }
        else if ( PageType_DIS == 2 )
        {
            if(FLASH_SYNC_1Hz)
            {
                SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 1, 1);
            }
            else
            {
                SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 1, 0);
            }
        }
        else 
        {
            SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), FLASH_SYNC_1Hz, 1, 1);
        }
    }
    else
    {
        SEG_SET_Clock(0, 0, 0, 0, 0);
李俭双's avatar
李俭双 committed
45
        LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_OFF);
李俭双's avatar
李俭双 committed
46 47 48 49
    }
}


李俭双's avatar
李俭双 committed
50 51 52



李俭双's avatar
李俭双 committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67


void Clear_Bu98(void)
{
    uint8_t i = 0;
    for(i = 0; i < BU98R10_DDRAM_SIZE; i ++)
    {
        BU98R10Chip0DDRAM.Byte[i] = 0;
        BU98R10Chip1DDRAM.Byte[i] = 0;
    }
}


void Gauge_Service(void)
{
李俭双's avatar
李俭双 committed
68
    static uint16_t VSpeed_Count = 0u;    
李俭双's avatar
李俭双 committed
69
    
李俭双's avatar
李俭双 committed
70 71 72 73 74 75 76 77
    if (ClearODO_Flag == 1)
    {
        if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON )
        {
            Check_SEG_Display();         
        }
        else
        {
李俭双's avatar
李俭双 committed
78
            Clear_Bu98();           
李俭双's avatar
李俭双 committed
79 80 81 82 83 84 85 86
        }
    }
    else
    {
        if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON )
        {
            if (Common_GetIgnOnTime() >= 3000)
            {
李俭双's avatar
李俭双 committed
87 88
                //for(i = 0; i < BU98R10_DDRAM_SIZE; i ++)
                //{
李俭双's avatar
李俭双 committed
89 90
                //    BU98R10Chip0DDRAM.Byte[i] = 0x77;
                //    BU98R10Chip1DDRAM.Byte[i] = 0x77;
李俭双's avatar
李俭双 committed
91
                //}
李俭双's avatar
李俭双 committed
92
                
李俭双's avatar
李俭双 committed
93 94 95 96 97 98
                if (VSpeed_Count < 3)
                {
                    VSpeed_Count++;
                }
                else 
                {
李俭双's avatar
李俭双 committed
99 100
                    VSpeed_Count = 0;                    
                    SEG_SET_VSpeed_NUM(1u, Get_DispVechileSpeed( ) / 10u,Get_Dis_KM_Unit());
李俭双's avatar
李俭双 committed
101 102
                }

李俭双's avatar
李俭双 committed
103 104 105 106 107 108 109
                SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(Get_Dis_KM_Unit(), Get_ODO_Value() / 10u, Get_Trip_Value());
                Gauge_Clock_Display();                
                SEG_SET_FuelDial(1, Get_CurFuelSetp());
                SEG_SET_EspeedDial(1,  Get_DispEngineSpeed()/500);
                SEG_SET_CoolantDial(1, GET_DataCoolantTempSegDisp(), GET_DataCoolantTempValueDisp(), GET_DataCollantTempSegValid());
                SEG_SET_Voltage_NUM(1, Get_Battery_Voltage());
                SEG_SET_TPMS_NUM(1, Get_Front_TPMS_Sig_Value(), Get_Rear_TPMS_Sig_Value(), Get_Dis_Tpms_Unit(),Get_Front_TPMS_Sig_Vaild(), Get_Rear_TPMS_Sig_Vaild());
李俭双's avatar
李俭双 committed
110 111 112 113 114 115 116 117 118
            }
            else
            {            
                Checkself_SEG_Display();                
            }
        }
        else
        {
            Clear_Bu98();
李俭双's avatar
李俭双 committed
119
            
李俭双's avatar
李俭双 committed
120 121 122 123 124
        }
    }    
        
}