DisplaySch_user.c 14.7 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8
#include "DisplaySch_user.h"
#include "Common_Interface.h"
#include "DispSch.h"
#include "Popup_Scheduler.h"
#include "Popup_List.h"
#include "Key.h"
#include "CAN_Lib.h"
#include "GUI.h"
hu's avatar
hu committed
9
#include "Services_ODO_User.h" /*清空总计里程函数*/
hu's avatar
hu committed
10
#include "Menu.h"
hu's avatar
hu committed
11
#include "jcua.h"
hu's avatar
hu committed
12
#include "kwp2000_service.h"
hu's avatar
hu committed
13

hu's avatar
hu committed
14 15
uint32_t EnterTimer[10];
uint8_t UE_EN[Display_MAX];
hu's avatar
hu committed
16 17
#pragma alignvar(8)
#pragma ghs section bss = default
hu's avatar
hu committed
18
uint8_t Mem[32];
hu's avatar
hu committed
19 20
#pragma ghs section bss = default

hu's avatar
hu committed
21
#pragma ghs section bss = ".myNonInitArea"
hu's avatar
hu committed
22
UE_CtrlInfo_Struct_t UE_CtrlInfo;
hu's avatar
hu committed
23
uint8_t BG_display_flag;
hu's avatar
hu committed
24
#pragma ghs section bss = default
hu's avatar
hu committed
25

hu's avatar
hu committed
26
uint16_t HMI_StartAnimationFrameCnt;
27
uint8_t backgroundOFFFlag;
hu's avatar
hu committed
28 29 30 31 32

static void switch_branch(void);

uint8_t Get_Pwr(void)
{
hu's avatar
hu committed
33
    return Common_Get_IG_Sts();
hu's avatar
hu committed
34 35 36
}
uint32_t Get_IG_ON(void)
{
hu's avatar
hu committed
37
    return Common_GetIgnOnTime();
hu's avatar
hu committed
38 39 40
}
uint32_t Get_IG_Off(void)
{
hu's avatar
hu committed
41
    return Common_GetIgnOffTime();
hu's avatar
hu committed
42 43
}

hu's avatar
hu committed
44
static const DispSch_Attr_st loc[] =
45
{
46 47 48 49
    {&UE_EN[Display_StartAnimation], UE_IGN_ON , Display_StartAnimation, ((void *)0), Display_StartAnimationEnter, Display_StartAnimationService, Display_StartAnimationExit},
    {&UE_EN[Display_Menu]          , UE_IGN_ON , Display_Menu          , ((void *)0), Display_MenuEnter          , Display_MenuService          , ((void *)0)},
    {&UE_EN[Display_Alarm]         , UE_IGN_ON , Display_Alarm         , ((void *)0), Display_AlarmEnter         , Display_AlarmService         , ((void *)0)},
    {&UE_EN[Display_Nothing]       , UE_IGN_OFF, Display_Nothing       , ((void *)0), Display_NothingEnter       , Display_NothingService       , ((void *)0)},
hu's avatar
hu committed
50 51 52 53
};

void DispSch_TotalInit(void)
{
hu's avatar
hu committed
54
    uint8_t i;
hu's avatar
hu committed
55
    DispSch_Ext_st m_st;
hu's avatar
hu committed
56 57
    m_st.Get_Power = Get_Pwr;
    m_st.Get_IG_ON_Timer = Get_IG_ON;
hu's avatar
hu committed
58 59
    m_st.Get_IG_OFF_Timer = Get_IG_Off;
    m_st.Get_IG_OFF_Timer = Get_IG_Off;
hu's avatar
hu committed
60
    m_st.TotalSize = Display_MAX;
hu's avatar
hu committed
61
    DispSch_Init(Mem, loc, &m_st, 0u);
hu's avatar
hu committed
62

hu's avatar
hu committed
63
    for (i = 0u; i < Display_MAX; i++)
hu's avatar
hu committed
64
    {
hu's avatar
hu committed
65
        UE_EN[i] = UE_Disable;
hu's avatar
hu committed
66
    }
hu's avatar
hu committed
67 68 69 70 71 72 73 74

    if (BG_display_flag == 0u)
    {
        BG_display_flag = 1u;
        MenuFlag.Menu_Popup_Flag = 0u ;

        MenuInit();
    }
hu's avatar
hu committed
75 76 77 78 79 80
}

void DisplayServices(void)
{
    uint32_t PowerOnTimer;
    uint32_t PowerOFFTimer;
hu's avatar
hu committed
81
    uint8_t PowerStatus;
82
    uint32_t Get_Menu_Off_Time = 0u;
hu's avatar
hu committed
83 84
    uint16_t popupID = 0xFFFFu;

hu's avatar
hu committed
85 86 87
    PowerStatus = Common_Get_IG_Sts();
    PowerOnTimer = Common_GetIgnOnTime();
    PowerOFFTimer = Common_GetIgnOffTime();
88
    Get_Menu_Off_Time = Coom_Get_Menu_Off_Time();
hu's avatar
hu committed
89

hu's avatar
hu committed
90
    if ((PowerOnTimer <= StartAnimationEnd) && (PowerOnTimer >= StartAnimationStart))
hu's avatar
hu committed
91
    {
hu's avatar
hu committed
92 93 94
        UE_EN[Display_StartAnimation] = UE_Enable;
        UE_EN[Display_Menu] = UE_Disable;
        UE_EN[Display_Alarm] = UE_Disable;
hu's avatar
hu committed
95
        UE_EN[Display_Nothing] = UE_Disable;
hu's avatar
hu committed
96 97 98
    }
    else
    {
hu's avatar
hu committed
99
        /*获取四种模式*/
hu's avatar
hu committed
100 101
        Meter_Mode_conversion();

hu's avatar
hu committed
102
        if ((K_Line_Set.K_Line_LID51 == 0x01u) && (MenuFlag.Menu_Test != 1u))
hu's avatar
hu committed
103 104 105
        {
            popupID = Popup_Get_Current_Message();
        }
106

hu's avatar
hu committed
107
        if ((popupID != 0xffffu) && (MenuFlag.Key_Menu_Popup_time == 0x00u))
hu's avatar
hu committed
108
        {
hu's avatar
hu committed
109
            UE_EN[Display_Alarm] = UE_Enable;
110 111 112 113 114 115 116 117 118

            if (PowerStatus == COMMON_POWER_ON)
            {
                ; /*不处理*/
            }
            else
            {
                UE_EN[Display_Nothing] = UE_Disable;
            }
hu's avatar
hu committed
119 120 121
        }
        else
        {
122 123
            if (MenuFlag.Key_Menu_Popup_time != 0x00u)
            {
hu's avatar
hu committed
124
                MenuFlag.Key_Menu_Popup_time--;
125 126 127
            }
            else
            {
hu's avatar
hu committed
128
                ; /*Do Nothing!*/
129 130
            }

hu's avatar
hu committed
131
            UE_EN[Display_Alarm] = UE_Disable;
hu's avatar
hu committed
132

hu's avatar
hu committed
133
            if (PowerStatus == COMMON_POWER_ON)
hu's avatar
hu committed
134
            {
hu's avatar
hu committed
135
                UE_EN[Display_Menu] = UE_Enable;
hu's avatar
hu committed
136 137 138
            }
            else
            {
139 140 141 142 143 144 145 146 147 148
                if ((State_Flag.Menu_Key_Static == 1u) && (Get_Menu_Off_Time < 150000))
                {
                    UE_EN[Display_Menu] = UE_Enable;
                    UE_EN[Display_Nothing] = UE_Disable;
                }
                else
                {
                    UE_EN[Display_Menu] = UE_Disable;
                    UE_EN[Display_Nothing] = UE_Enable;
                }
hu's avatar
hu committed
149 150
            }
        }
hu's avatar
hu committed
151 152
    }

153
    DispSch_xxxMs_Logic(10u);
hu's avatar
hu committed
154

155
    /*上短*/
hu's avatar
hu committed
156
    if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_UP == KEY_EVENT_SHORT_PRESS)
157 158 159 160
    {
        HMI_Clear_KEY_UP();
    }
    /*上长*/
hu's avatar
hu committed
161
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_UP == KEY_EVENT_LONG_PRESS)
162 163 164 165
    {
        HMI_Clear_KEY_UP();
    }
    /*下短*/
hu's avatar
hu committed
166
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_DOWN == KEY_EVENT_SHORT_PRESS)
167 168 169 170
    {
        HMI_Clear_KEY_DOWN();
    }
    /*下长*/
hu's avatar
hu committed
171
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_DOWN == KEY_EVENT_LONG_PRESS)
172 173 174 175
    {
        HMI_Clear_KEY_DOWN();
    }
    /*确认短*/
hu's avatar
hu committed
176
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CONFIRM == KEY_EVENT_SHORT_PRESS)
177 178 179 180
    {
        HMI_Clear_KEY_CONFIRM();
    }
    /*确认长*/
hu's avatar
hu committed
181
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CONFIRM == KEY_EVENT_LONG_PRESS)
182 183 184
    {
        HMI_Clear_KEY_CONFIRM();
    }
185
    /*确认超长 15 S*/
hu's avatar
hu committed
186
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CONFIRM == KEY_EVENT_SUPER_LONG_PRESS)
187 188
    {
        HMI_Clear_KEY_CONFIRM();
hu's avatar
hu committed
189

190 191 192 193
        /*TYW总计清零*/
        TYW_Data_ODO_Clear();
    }
    /*返回短*/
hu's avatar
hu committed
194
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CANCEL == KEY_EVENT_SHORT_PRESS)
195 196 197 198
    {
        HMI_Clear_KEY_CANCEL();
    }
    /*返回长*/
hu's avatar
hu committed
199
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_CANCEL == KEY_EVENT_LONG_PRESS)
200 201 202 203
    {
        HMI_Clear_KEY_CANCEL();
    }
    /*MENU短*/
hu's avatar
hu committed
204
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_MENU == KEY_EVENT_SHORT_PRESS)
205 206 207 208
    {
        HMI_Clear_KEY_MENU();
    }
    /*MENU长*/
hu's avatar
hu committed
209
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_MENU == KEY_EVENT_LONG_PRESS)
210 211 212 213 214
    {
        HMI_Clear_KEY_MENU();
    }
    else
    {
hu's avatar
hu committed
215
        ; /*do nothing*/
216
    }
217

218 219 220 221 222 223 224 225 226 227
    /*ODOTrip短*/
    if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_ODOTRIP == KEY_EVENT_SHORT_PRESS)
    {
        HMI_Clear_KEY_ODOTRIP();
    }
    /*ODOTrip长*/
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_ODOTRIP == KEY_EVENT_LONG_PRESS)
    {
        HMI_Clear_KEY_ODOTRIP();
    }
228 229 230 231 232
    /*ODO off-to-on*/
    else if (UE_CtrlInfo.HMI_KEYInfo.u8KEY_ODOTRIP == KEY_EVENT_OFF_TO_ON)
    {
        HMI_Clear_KEY_ODOTRIP();
    }
233 234 235 236
    else
    {
        ; /*do nothing*/
    }
hu's avatar
hu committed
237
}
238

239
/*----开机动画----*/
240 241
void Display_StartAnimationEnter(void)
{
hu's avatar
hu committed
242
    HMI_StartAnimationFrameCnt = 0u;
243
    backgroundOFFFlag = 0;
hu's avatar
hu committed
244 245
    MenuFlag.Menu_Popup_Flag = 0u ;

246
    /*硬清空所有缓存数据*/
hu's avatar
hu committed
247
    loc_free_mem(MENU_Sprite, MENU_Sprite);
248

249 250 251
    /*使能底图窗口*/
    JCUA_Enable_window();
}
252 253 254 255 256 257
void Display_StartAnimationService(void)
{
    uint16_t m16_FrameCnt;

    HMI_StartAnimationFrameCnt++;
    m16_FrameCnt = HMI_StartAnimationFrameCnt;
hu's avatar
hu committed
258 259

    if ((m16_FrameCnt % 4) == 0u)
260
    {
hu's avatar
hu committed
261
        GUI_Display_Animation_Frame(m16_FrameCnt / 4u);
262 263 264 265 266 267
    }
}
void Display_StartAnimationExit(void)
{
}

hu's avatar
hu committed
268 269 270 271 272
uint16_t Common_GetHMI_StartAnimationFrameCnt(void)
{
    return HMI_StartAnimationFrameCnt;
}

273 274 275
/*----菜单----*/
void Display_MenuEnter (void)
{
276 277 278 279 280 281 282 283
    /*开机动画播放完毕使能底图窗口 二次使能窗口*/
    JCUA_Enable_window();

    /*使能PNG窗口*/
    loc_Enable_Window_App();

    /*刷底图*/
    GUI_Display_background();
284
}
285 286 287
void Display_MenuService(void)
{
}
288 289 290 291
/*----报警----*/
void Display_AlarmEnter (void)
{
}
hu's avatar
hu committed
292 293 294 295
void Display_AlarmService(void)
{
}

296
/*----Nothing----*/
297 298 299
void Display_NothingEnter(void)
{
    JCUA_Disable_window();
300 301
    loc_Disable_Window_App( );
    loc_free_mem(WET_Sprite, MENU_Sprite);
302 303 304 305 306 307
}
void Display_NothingService(void)
{

}

hu's avatar
hu committed
308 309
void GUI_DisplayServices(void)
{
310 311
    uint16_t DispVSpeed = 0u;
    uint16_t DispESpeed = 0u;
312
    uint32_t PowerStatus = 0u;
hu's avatar
hu committed
313
    UElib_uint16_t HMI_MENU_Sta = 0u;
hu's avatar
hu committed
314 315

    HMI_MENU_Sta = Get_Cur_HMI();
316
    PowerStatus = Common_Get_IG_Sts();
317
    DispVSpeed = Common_Get_Disp_V_Speed();
hu's avatar
hu committed
318

hu's avatar
hu committed
319
    if (HMI_MENU_Sta == Display_Alarm)
hu's avatar
hu committed
320
    {
hu's avatar
hu committed
321
        loc_Del_Sprite(MENU_Sprite, MENU_Sprite);
hu's avatar
hu committed
322

hu's avatar
hu committed
323 324 325 326 327 328 329 330 331
        if (Common_Get_window_Sta() != 1u)
        {
            JCUA_Enable_window();
        }

        if (MenuFlag.Menu_Popup_Flag == 0u)
        {
            MenuFlag.Menu_Popup_Flag = 1u;

332 333 334 335 336 337 338 339 340
            if (bCurMenuIDX < _MN_DSP_Menu_OFF)
            {
                MenuFlag.Meun_Test_Dealer = bCurMenuIDX ;
            }
            else
            {
                MenuFlag.Meun_Test_Dealer = 0u;
            }

hu's avatar
hu committed
341
            NextMenu(_MN_DSP_LEVEPOPUP);
hu's avatar
hu committed
342
            bCurMenuIDX = _MN_DSP_LEVEPOPUP;
hu's avatar
hu committed
343
        }
hu's avatar
hu committed
344
    }
hu's avatar
hu committed
345
    else if ((HMI_MENU_Sta == Display_Menu) || (HMI_MENU_Sta == Display_Nothing))
hu's avatar
hu committed
346
    {
hu's avatar
hu committed
347
        if (PowerStatus == COMMON_POWER_ON)
hu's avatar
hu committed
348
        {
hu's avatar
hu committed
349
            if (MenuFlag.Menu_Factory == 1u)
hu's avatar
hu committed
350 351 352 353
            {
                MenuFlag.Menu_Factory = 0u;
                MenuFlag.Menu_Popup_Flag = 2u;

hu's avatar
hu committed
354 355
                NextMenu( _FAC_DSP_LEVEL0MENU_1 );
                bCurMenuIDX = _FAC_DSP_LEVEL0MENU_1;
hu's avatar
hu committed
356 357 358 359 360 361
            }
            else if (MenuFlag.Menu_Dealer == 1u)
            {
                MenuFlag.Menu_Dealer = 0u;
                MenuFlag.Menu_Popup_Flag = 3u;

hu's avatar
hu committed
362 363
                NextMenu( _DEA_DSP_LEVEL0MENU_1 );
                bCurMenuIDX = _DEA_DSP_LEVEL0MENU_1;
hu's avatar
hu committed
364 365 366 367 368 369 370
            }
            else if (MenuFlag.Menu_Test == 1u)
            {
                MenuFlag.Menu_Test = 0;
                MenuFlag.Menu_Popup_Flag = 4u;

                NextMenu( _MN_DSP_Menu_Test );
hu's avatar
hu committed
371 372 373 374 375 376
                bCurMenuIDX = _MN_DSP_Menu_Test;
            }
            else  if (MenuFlag.Menu_Popup_Flag == 1u)
            {
                MenuFlag.Menu_Popup_Flag = 0u;

377 378 379 380 381 382 383 384 385 386
                if (DispVSpeed > 66u)
                {
                    NextMenu(MenuFlag.Menu_Flag);
                    bCurMenuIDX = MenuFlag.Menu_Flag;
                }
                else
                {
                    NextMenu(MenuFlag.Meun_Test_Dealer);
                    bCurMenuIDX = MenuFlag.Meun_Test_Dealer;
                }
hu's avatar
hu committed
387
            }
hu's avatar
hu committed
388

hu's avatar
hu committed
389
            if (((bCurMenuIDX > _MN_DSP_LEVEPOPUP) && (bCurMenuIDX < _MN_DSP_LEVEL3_5_MENU_1)) ||
hu's avatar
hu committed
390
                    (bCurMenuIDX >= _FAC_DSP_LEVEL0MENU_1))
hu's avatar
hu committed
391
            {
hu's avatar
hu committed
392
                loc_Del_Sprite(ADAS_Sprite, Gear_Sprite);
393
                loc_Del_Sprite(MENU_Sprite, MENU_Sprite);
hu's avatar
hu committed
394
                if (Common_Get_window_Sta() != 0u)
395
                {
hu's avatar
hu committed
396
                    JCUA_Disable_window();
397
                }
hu's avatar
hu committed
398 399 400
            }
            else
            {
hu's avatar
hu committed
401 402 403 404 405
                loc_Del_Sprite(MENU_Sprite, MENU_Sprite);
                if (Common_Get_window_Sta() != 1u)
                {
                    JCUA_Enable_window();
                }
hu's avatar
hu committed
406
            }
hu's avatar
hu committed
407
        }
hu's avatar
hu committed
408 409 410 411 412 413 414
        else
        {
            ;/*Do Nothing!*/
            //BG_display_flag = 0u;
            //NextMenu(_MN_DSP_Menu_OFF);
        }
    }
hu's avatar
hu committed
415
    if (HMI_MENU_Sta != Display_StartAnimation)
hu's avatar
hu committed
416
    {
hu's avatar
hu committed
417 418 419 420 421 422
        if (PowerStatus == COMMON_POWER_ON)
        {
            MenuManage();
        }
        else
        {
423 424 425
            if (backgroundOFFFlag == 0u)
            {
                loc_Enable_Window_App();
hu's avatar
hu committed
426 427
                GUI_Display_backgroundOFF();

428 429 430
                loc_Del_Sprite(MENU_Sprite, MENU_Sprite);
                backgroundOFFFlag = 1u;
            }
hu's avatar
hu committed
431

hu's avatar
hu committed
432 433 434
            GUI_Time_OilTemp_OFF_Display(GUI_DISP_MODE_NORMAL);
            BG_display_flag = 0u;
        }
hu's avatar
hu committed
435 436 437
    }
    else
    {
hu's avatar
hu committed
438
        ; /*Do  Nothing!*/
hu's avatar
hu committed
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
    }
}

void HMI_Set_KEY_UP(uint8_t u8KeyVal)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_UP = u8KeyVal;
}
void HMI_Set_KEY_DOWN(uint8_t u8KeyVal)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_DOWN = u8KeyVal;
}
void HMI_Set_KEY_CONFIRM(uint8_t u8KeyVal)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_CONFIRM = u8KeyVal;
}
void HMI_Set_KEY_CANCEL(uint8_t u8KeyVal)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_CANCEL = u8KeyVal;
}
void HMI_Set_KEY_MENU(uint8_t u8KeyVal)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_MENU = u8KeyVal;
}
462 463 464 465
void HMI_Set_KEY_ODOTRIP(uint8_t u8KeyVal)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_ODOTRIP = u8KeyVal;
}
hu's avatar
hu committed
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486

void HMI_Clear_KEY_UP(void)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_UP = 0u;
}
void HMI_Clear_KEY_DOWN(void)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_DOWN = 0u;
}
void HMI_Clear_KEY_CONFIRM(void)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_CONFIRM = 0u;
}
void HMI_Clear_KEY_CANCEL(void)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_CANCEL = 0u;
}
void HMI_Clear_KEY_MENU(void)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_MENU = 0u;
}
487 488 489 490
void HMI_Clear_KEY_ODOTRIP(void)
{
    UE_CtrlInfo.HMI_KEYInfo.u8KEY_ODOTRIP = 0u;
}
hu's avatar
hu committed
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506

void Meter_Mode_conversion(void)
{
    uint16_t popupID = 0xFFFFu;
    uint16_t DispVSpeed = 0u;
    uint16_t DispESpeed = 0u;

    DispVSpeed = Common_Get_Disp_V_Speed();
    DispESpeed = Common_Get_Act_E_Speed();

    /*工厂模式*/
    if (MenuFlag.Menu_Popup_Flag == 2u)
    {
        if (K_Line_Set.K_Line_LID51 == 0x01u)
        {
            popupID = Popup_Get_Current_Message();
hu's avatar
hu committed
507
            if ((popupID != 0xffffu) && (MenuFlag.Key_Menu_Popup_time == 0x00u))
hu's avatar
hu committed
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
            {
                MenuFlag.Menu_Popup_Flag = 0u;
            }
            else
            {
                MenuFlag.Menu_Popup_Flag = 1u;
            }
        }
        else if (K_Line_Set.K_Line_LID51 == 0x02u)
        {
            MenuFlag.Menu_Dealer = 1u;
        }
        else
        {
            ;/*Do Nothing!*/
        }
    }
    /*经销商模式*/
    else if (MenuFlag.Menu_Popup_Flag == 3u)
    {
        if (K_Line_Set.K_Line_LID51 == 0x01u)
        {
            popupID = Popup_Get_Current_Message();
hu's avatar
hu committed
531
            if ((popupID != 0xffffu) && (MenuFlag.Key_Menu_Popup_time == 0x00u))
hu's avatar
hu committed
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
            {
                MenuFlag.Menu_Popup_Flag = 0u;
            }
            else
            {
                MenuFlag.Menu_Popup_Flag = 1u;
            }
        }
        else if (K_Line_Set.K_Line_LID51 == 0x00u)
        {
            MenuFlag.Menu_Factory = 1u;
        }
        else
        {
            ;/*Do Nothing!*/
        }
    }
    /*自检模式*/
    else if (MenuFlag.Menu_Popup_Flag == 4u)
    {
        if ((DispVSpeed >= 66u) || (DispESpeed >= 330u))
        {
            popupID = Popup_Get_Current_Message();
hu's avatar
hu committed
555
            if ((popupID != 0xffffu) && (MenuFlag.Key_Menu_Popup_time == 0x00u))
hu's avatar
hu committed
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576
            {
                MenuFlag.Menu_Popup_Flag = 0u;
            }
            else
            {
                MenuFlag.Menu_Popup_Flag = 1u;
            }
        }
        else if (K_Line_Set.K_Line_LID51 == 0x02u)
        {
            MenuFlag.Menu_Dealer = 1u;
        }
        else
        {
            ;/*Do Nothing!*/
        }
    }
    /*通常模式*/
    else
    {
        /*进入自检模式*/
577 578
        if ((MenuFlag.Key_MenuTest_Long == 1u) && (MenuFlag.Key_MenuTest_ShortNum >= 3u))
            //if (MenuFlag.Key_MenuTest_ShortNum >= 3u)
hu's avatar
hu committed
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593
        {
            MenuFlag.Menu_Test = 1u;
            MenuFlag.Key_MenuTest_Long = 0u;
            MenuFlag.Key_MenuTest_ShortNum = 0u;
        }
        else if (K_Line_Set.K_Line_LID51 == 0x00u)
        {
            MenuFlag.Menu_Factory = 1u;
        }
        else if (K_Line_Set.K_Line_LID51 == 0x02u)
        {
            MenuFlag.Menu_Dealer = 1u;
        }
        else
        {
594
            ;/*Do Nothing!*/
hu's avatar
hu committed
595 596 597
        }
    }
}