GUI_Display.c 5.36 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
void Gauge_Clock_Display(void)
{
    uint8_t PageType_DIS = 0;
8
    if (SYS_OPR_STAT_IGN_ON)
李俭双's avatar
李俭双 committed
9 10 11
    {
        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


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

65
uint8_t u8VspeedCount = 0;
李俭双's avatar
李俭双 committed
66 67
void Gauge_Service(void)
{
李俭双's avatar
李俭双 committed
68
    static uint16_t VSpeed_Count = 0u;    
69
    uint8_t k = 0;
李俭双's avatar
李俭双 committed
70 71
    if (ClearODO_Flag == 1)
    {
72
        if ( SYS_OPR_STAT_IGN_ON )
李俭双's avatar
李俭双 committed
73
        {
74 75 76
            Check_SEG_Display();    
            for(k = 0; k < LampCh0_MAX; k ++)     
            {
77
                if (k == 24 || k == 21 || k == 13 || k == 26)
78
                {
79
                    //k ++;
80 81 82 83 84 85 86 87
                }
                else
                {
                    LED_Driver_Channel_Set(LampChannel_0, k, LED_ON); 
                }
                
            }
            
李俭双's avatar
李俭双 committed
88 89 90
        }
        else
        {
91 92 93 94 95
            Clear_Bu98();  
            for(k = 0; k < LampCh0_MAX; k ++)     
            {
                LED_Driver_Channel_Set(LampChannel_0, k, LED_OFF); 
            }
96
                  
李俭双's avatar
李俭双 committed
97 98 99 100
        }
    }
    else
    {
101
        if ( SYS_OPR_STAT_IGN_ON )
李俭双's avatar
李俭双 committed
102
        {
103
            if (Common_GetIgnOnTime() >= 3030)
李俭双's avatar
李俭双 committed
104
            {
李俭双's avatar
李俭双 committed
105 106
                //for(i = 0; i < BU98R10_DDRAM_SIZE; i ++)
                //{
李俭双's avatar
李俭双 committed
107 108
                //    BU98R10Chip0DDRAM.Byte[i] = 0x77;
                //    BU98R10Chip1DDRAM.Byte[i] = 0x77;
李俭双's avatar
李俭双 committed
109
                //}
李俭双's avatar
李俭双 committed
110
                
111 112 113 114 115 116 117 118 119
                if(u8VspeedCount < 3)
                {
                    u8VspeedCount ++ ;
                }
                else
                {
                    u8VspeedCount = 0;
                    SEG_SET_VSpeed_NUM(1u, Get_DispVechileSpeed( ) / 10u,Get_Dis_KM_Unit());
                }
120
                
李俭双's avatar
李俭双 committed
121

李俭双's avatar
李俭双 committed
122 123 124 125
                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);
126
                SEG_SET_CoolantDial(1, GET_DataCoolantTempSegDisp(), GET_DataCoolantSegValue(), GET_DataCollantTempSegValid());
李俭双's avatar
李俭双 committed
127
                SEG_SET_Voltage_NUM(1, Get_Battery_Voltage());
128
            #if(IC_Current == TY200_080000b_ty) 
129 130 131
                SEG_SET_TPMS_DISPLAY(1, Get_Front_TPMS_Sig_Value(), Get_Rear_TPMS_Sig_Value(), 0 ,Get_Front_TPMS_Sig_Vaild(), Get_Rear_TPMS_Sig_Vaild());    
                LED_Driver_Channel_Set(LampChannel_0, LampCh0_03, LED_ON);   
                LED_Driver_Channel_Set(LampChannel_0, LampCh0_04, LED_ON); 
132
            #endif    
133
                SEG_SET_Navigation_STS(Get_Navigation_St_Dis(),Get_Navigation_Code_Dis(),Get_Navigation_Mileage_Dis());
134
          
李俭双's avatar
李俭双 committed
135 136 137
            }
            else
            {            
138 139
                LED_Driver_Channel_Set(LampChannel_0, LampCh0_03, LED_ON);   
                LED_Driver_Channel_Set(LampChannel_0, LampCh0_04, LED_ON); 
李俭双's avatar
李俭双 committed
140 141 142 143 144 145
                Checkself_SEG_Display();                
            }
        }
        else
        {
            Clear_Bu98();
146 147 148

            LED_Driver_Channel_Set(LampChannel_0, LampCh0_03, LED_OFF);   
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_04, LED_OFF); 
149 150 151 152 153 154
           
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_35_ODO, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_KMH, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_09_MPH, LED_OFF);
155 156 157 158
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_10_Navigator1, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_19_Navigator2, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_17_Length2, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_18_Length1, LED_OFF);
159
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_14_ARRIVED_SERVICE_AREA, LED_OFF);
160 161
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_ARRIVED_TOLLGATE, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_16_ARRIVED_TUNNEL, LED_OFF);
李俭双's avatar
李俭双 committed
162 163 164 165 166
        }
    }    
        
}