Telltales_user.c 55.9 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8 9 10 11 12 13
//ZH修改2021年8月27日16:58:42

#include "GPIO.h"
#include "Telltales.h"
#include "Telltales_user.h"
#include "CAN_Communication_Matrix.h"
#include "Flash_synchronizer.h"
#include "EOL_Para.h"
#include "Sound_Scheduler.h"
#include "SEG_DISPLAY.h"
#include "Maintenance.h"
#include "Line_in.h"
#include "IS31FL3236.h"
hu's avatar
hu committed
14
#include "Service_TPMS.h"
hu's avatar
hu committed
15
#include "Data_AirPressure.h"
16
#include "Data_CoolantTemperature.h"
hu's avatar
hu committed
17 18
#include "FuelConfig.h"
#include "Data_Fuel_User.h"
hu's avatar
hu committed
19

hu's avatar
hu committed
20
static uint8_t L12_Air_Sta ;
hu's avatar
hu committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34

TelltaleLRCtrlStruct TelltaleLRCtrl;

const LED_Attribute_st LED_Attribute[LED_Max] =
{
    /*  指示灯索引                             是否自检         外部信号自检       工作电源状态       自检开始时间    自检持续时间       指示灯点亮条件                           指示灯执行函数               */
    {   em_LED_INTER_DIFF_LOCK_T          , NoSelfCheck ,     ExterNalCheck ,  LED_IGN_ON_OFF ,       0u,         3000ul,     LED_INTER_DIFF_LOCK_T_Judgement          , LED_INTER_DIFF_LOCK_T_Execution            },
    {   em_LED_FOUR_MUL_FOUR_T            , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_FOUR_MUL_FOUR_T_Judgement            , LED_FOUR_MUL_FOUR_T_Execution              },
    {   em_LED_EXH_BRAKE_T                , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_EXH_BRAKE_T_Judgement                , LED_EXH_BRAKE_T_Execution                  },
    {   em_LED_QOS_GLOW_T                 ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_QOS_GLOW_T_Judgement                 , LED_QOS_GLOW_T_Execution                   },
    {   em_LED_HI_BEAM_T                  , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_HI_BEAM_T_Judgement                  , LED_HI_BEAM_T_Execution                    },
    {   em_LED_Rr_FOG_LAMP_T              , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_Rr_FOG_LAMP_T_Judgement              , LED_Rr_FOG_LAMP_T_Execution                },
    {   em_LED_MIL_T                      ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_MIL_T_Judgement                      , LED_MIL_T_Execution                        },
    {   em_LED_SVS_T                      ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_SVS_T_Judgement                      , LED_SVS_T_Execution                        },
hu's avatar
hu committed
35
    {   em_LED_H_S_A__T                   , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_H_S_A_T_Judgement                    , LED_H_S_A_T_Execution                     },
hu's avatar
hu committed
36 37 38 39 40 41 42 43 44 45 46
    {   em_LED_RETARDER_T                 ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_RETARDER_T_Judgement                 , LED_RETARDER_T_Execution                   },
    {   em_LED_AUTO_LEVELING_T            , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_AUTO_LEVELING_T_Judgement            , LED_AUTO_LEVELING_T_Execution              },
    {   em_LED_ROWS_L                     , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_ROWS_L_Judgement                     , LED_ROWS_L_Execution                       },
    {   em_LED_BSM_OFF_L                  , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_BSM_OFF_L_Judgement                  , LED_BSM_OFF_L_Execution                    },
    {   em_LED_AEBS_OFF_L                 , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_AEBS_OFF_L_Judgement                 , LED_AEBS_OFF_L_Execution                   },
    {   em_LED_LDWS_L                     , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_LDWS_L_Judgement                     , LED_LDWS_L_Execution                       },
    {   em_LED_SRS_L                      , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_SRS_L_Judgement                      , LED_SRS_L_Execution                        },
    {   em_LED_ENG_OIL_L                  ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_ENG_OIL_L_Judgement                  , LED_ENG_OIL_L_Execution                    },
    {   em_LED_CHARG_L                    ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_CHARG_L_Judgement                    , LED_CHARG_L_Execution                      },
    {   em_LED_SEAT_BELT_L                ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_SEAT_BELT_L_Judgement                , LED_SEAT_BELT_L_Execution                  },
    {   em_LED_RR_DIFF_LOCK_L             ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_RR_DIFF_LOCK_L_Judgement             , LED_RR_DIFF_LOCK_L_Execution               },
hu's avatar
hu committed
47
    {   em_LED_TPMS_L                     ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_TPMS_L_Judgement                     , LED_TPMS_L_Execution                       },
hu's avatar
hu committed
48 49 50 51 52 53 54 55
    {   em_LED_ASR_or_EVSC_OFF_L          , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_ASR_or_EVSC_OFF_L_Judgement          , LED_ASR_or_EVSC_OFF_L_Execution            },
    {   em_LED_EVSC_L                     , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_EVSC_L_Judgement                     , LED_EVSC_L_Execution                       },
    {   em_LED_eco_stop_OFF_L             , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_eco_stop_OFF_L_Judgement             , LED_eco_stop_OFF_L_Execution               },
    {   em_LED_AMT_L                      , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_AMT_L_Judgement                      , LED_AMT_L_Execution                        },
    {   em_LED_WEAR_IND_L                 , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_WEAR_IND_L_Judgement                 , LED_WEAR_IND_L_Execution                   },
    {   em_LED_TRAILER_BRAKE_R            ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_TRAILER_BRAKE_R_Judgement            , LED_TRAILER_BRAKE_R_Execution              },
    {   em_LED_BRAKE_AIR_or_EBS_YELLOW_R  , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_BRAKE_AIR_or_EBS_YELLOW_R_Judgement  , LED_BRAKE_AIR_or_EBS_YELLOW_R_Execution    },
    {   em_LED_ACC_AIR_R                  , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_ACC_AIR_R_Judgement                  , LED_ACC_AIR_R_Execution                    },
hu's avatar
hu committed
56
    {   em_LED_ABS_R                      ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_ABS_R_Judgement                      , LED_ABS_R_Execution                        },
hu's avatar
hu committed
57 58 59 60 61 62 63
    {   em_LED_PARK_BRAKE_R               ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_PARK_BRAKE_R_Judgement               , LED_PARK_BRAKE_R_Execution                 },
    {   em_LED_BRAKE_AIR_or_EBS_RED_R     , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_BRAKE_AIR_or_EBS_RED_R_Judgement     , LED_BRAKE_AIR_or_EBS_RED_R_Execution       },
    {   em_LED_BRAKE_LOCK_R               , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_BRAKE_LOCK_R_Judgement               , LED_BRAKE_LOCK_R_Execution                 },
    {   em_LED_AIR_SUS_R                  ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_AIR_SUS_R_Judgement                  , LED_AIR_SUS_R_Execution                    },
    {   em_LED_TRAILER_ABS_U              ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_TRAILER_ABS_U_Judgement              , LED_TRAILER_ABS_U_Execution                },
    {   em_LED_WORKING_LAMP_U             , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_WORKING_LAMP_U_Judgement             , LED_WORKING_LAMP_U_Execution               },
    {   em_LED_TRAILER_ABS_INFO_U         , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_TRAILER_ABS_INFO_U_Judgement         , LED_TRAILER_ABS_INFO_U_Execution           },
hu's avatar
hu committed
64 65
    {   em_LED_TEMP                       , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_Temp_Judgement                       , LED_Temp_Execution                         },
    {   em_LED_FUEL                       , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_Fuel_Judgement                       , LED_Fuel_Execution                         },
hu's avatar
hu committed
66 67 68 69 70 71 72 73 74 75 76
};

/*must put into 10ms task*/

void Telltales_Left_Right_KL30_Init(void);

void Telltales_Left_Right_KL30_Init(void)
{
    TelltaleLRCtrl.LastRight = 0u;
    TelltaleLRCtrl.LastLeft = 0u;
    TelltaleLRCtrl.Delay = 0u;
hu's avatar
hu committed
77 78

    L12_Air_Sta = 0u;
hu's avatar
hu committed
79
}
hu's avatar
hu committed
80

hu's avatar
hu committed
81
/******************************************************************************
hu's avatar
hu committed
82
  T3 L16 U1 U4 U5无灯   左右转向单独 气压1 气压2 指示灯是背光
hu's avatar
hu committed
83
 ******************************************************************************/
hu's avatar
hu committed
84

hu's avatar
hu committed
85 86 87 88
/******************************************************************************
  T0 左转向   T13 右转向
  信号接口:
  信号定义:
hu's avatar
hu committed
89
  输出信号:
hu's avatar
hu committed
90
 ******************************************************************************/
hu's avatar
hu committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104
void Telltales_Left_Right_Management_Service(void) /*10ms*/
{
    uint8_t Edge;
    uint8_t RIGHT_ST = 0x00u;
    uint8_t LEFT_ST = 0x00u;

    RIGHT_ST = Line_In_Get_Status(LINE_IN_TURN_R);
    LEFT_ST = Line_In_Get_Status(LINE_IN_TURN_L);

    Edge = 0xffu ;

    if (LEFT_ST == 1u)//左转向
    {
        SEG_LED_TURN_LEFT(7);//左转向断码屏开
105
        IS31_CHIP0_CHANNEL36 = 0x3Fu;
hu's avatar
hu committed
106 107 108 109 110 111
    }
    else
    {
        SEG_LED_TURN_LEFT(0);
        IS31_CHIP0_CHANNEL36 = 0x00u;
    }
112
    if (TelltaleLRCtrl.LastLeft != LEFT_ST)
hu's avatar
hu committed
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
    {
        TelltaleLRCtrl.LastLeft = LEFT_ST;
        Edge = LEFT_ST;
    }

    if (RIGHT_ST == 1u)//右转向
    {
        SEG_LED_TURN_RIGHT(7);//右转向断码屏开
        IS31_CHIP0_CHANNEL24 = 0x3Fu;
    }
    else
    {
        SEG_LED_TURN_RIGHT(0);
        IS31_CHIP0_CHANNEL24 = 0x00u;
    }

    if (TelltaleLRCtrl.LastRight != RIGHT_ST)
    {
        TelltaleLRCtrl.LastRight = RIGHT_ST;
        Edge = RIGHT_ST;
    }

    if (TelltaleLRCtrl.Delay > 0u)
    {
        TelltaleLRCtrl.Delay--;
    }
    else
    {
        if (Edge != 0xFFu)
        {
            if (Edge)
            {
                Sound_Request(SND_TICK, 1u);
            }
            else
            {
                Sound_Request(SND_TOCK, 1u);
            }

            TelltaleLRCtrl.Delay = 10u; /*200ms内不允许重复播放声音*/
        }
        else
        {
            Sound_Delete(SND_TICK);
            Sound_Delete(SND_TOCK);
        }
    }
}

162
#if 0
hu's avatar
hu committed
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
/*************************************

测试用

**************************************/
void Test_LED_AllLight(void)
{
    LED_INTER_DIFF_LOCK_T_Execution(LED_ON_State);
    LED_FOUR_MUL_FOUR_T_Execution(LED_ON_State);
    LED_EXH_BRAKE_T_Execution(LED_ON_State);
    LED_QOS_GLOW_T_Execution(LED_ON_State);
    LED_HI_BEAM_T_Execution(LED_ON_State);
    LED_Rr_FOG_LAMP_T_Execution(LED_ON_State);
    LED_MIL_T_Execution(LED_ON_State);
    LED_SVS_T_Execution(LED_ON_State);
    LED_H_S_A__T_Execution(LED_ON_State);
    LED_RETARDER_T_Execution(LED_ON_State);
    LED_AUTO_LEVELING_T_Execution(LED_ON_State);
    LED_ROWS_L_Execution(LED_ON_State);
    LED_BSM_OFF_L_Execution(LED_ON_State);
    LED_AEBS_OFF_L_Execution(LED_ON_State);
    LED_LDWS_L_Execution(LED_ON_State);
    LED_SRS_L_Execution(LED_ON_State);
    LED_ENG_OIL_L_Execution(LED_ON_State);
    LED_CHARG_L_Execution(LED_ON_State);
    LED_SEAT_BELT_L_Execution(LED_ON_State);
    LED_RR_DIFF_LOCK_L_Execution(LED_ON_State);
    LED_TPMS_L_Execution(LED_ON_State);
    LED_ASR_or_EVSC_OFF_L_Execution(LED_ON_State);
    LED_EVSC_L_Execution(LED_ON_State);
    LED_eco_stop_OFF_L_Execution(LED_ON_State);
    LED_AMT_L_Execution(LED_ON_State);
    LED_WEAR_IND_L_Execution(LED_ON_State);
    LED_TRAILER_BRAKE_R_Execution(LED_ON_State);
    LED_BRAKE_AIR_or_EBS_YELLOW_R_Execution(LED_ON_State);
    LED_ACC_AIR_R_Execution(LED_ON_State);
    LED_ABS_R_Execution(LED_ON_State);
    LED_PARK_BRAKE_R_Execution(LED_ON_State);
    LED_BRAKE_AIR_or_EBS_RED_R_Execution(LED_ON_State);
    LED_BRAKE_LOCK_R_Execution(LED_ON_State);
    LED_AIR_SUS_R_Execution(LED_ON_State);
    LED_TRAILER_ABS_U_Execution(LED_ON_State);
    LED_WORKING_LAMP_U_Execution(LED_ON_State);
    LED_TRAILER_ABS_INFO_U_Execution(LED_ON_State);
}

#endif

hu's avatar
hu committed
211
/*---------------------------------------------------------------------------*/
hu's avatar
hu committed
212 213 214
#define XXXX  0u
#define LED_BRIGHTNESS 0xff

215 216
/******************************************************************************
  T1  INTER DIFF LOCK
hu's avatar
hu committed
217
  信号接口:  B36 HIGH
218
  信号定义:
hu's avatar
hu committed
219
  输出信号:
220
 ******************************************************************************/
hu's avatar
hu committed
221 222 223 224
uint8_t LED_INTER_DIFF_LOCK_T_Judgement(void)
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
225 226

    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_RR_DIFF_LOCK);
hu's avatar
hu committed
227 228 229 230 231 232 233 234 235 236 237 238 239

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}

240 241
void LED_INTER_DIFF_LOCK_T_Execution(uint8_t led_status)
{
hu's avatar
hu committed
242
    RR_DIFF_LOCK_MCU = led_status;
243 244 245 246 247 248 249 250 251 252 253 254

    if (led_status == 1)
    {
        SEG_LED_INTER_DIFF_LOCK_T(7);
    }
    else
    {
        SEG_LED_INTER_DIFF_LOCK_T(0);
    }
}

/******************************************************************************
hu's avatar
hu committed
255
  T2
256 257
  信号接口:
  信号定义:
hu's avatar
hu committed
258
  输出信号:
259
 ******************************************************************************/
hu's avatar
hu committed
260
uint8_t LED_FOUR_MUL_FOUR_T_Judgement(void)
261 262 263
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
264
    m_Condition1 = (uint8_t)XXXX;
265 266 267 268 269 270 271 272 273 274 275 276

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
277
void LED_FOUR_MUL_FOUR_T_Execution(uint8_t led_status)
278
{
hu's avatar
hu committed
279 280 281 282 283 284 285 286
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL35 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL35 = 0x00;
    }
287 288 289

    if (led_status == 1)
    {
hu's avatar
hu committed
290
        SEG_LED_FOUR_MUL_FOUR_T(7);
291 292 293
    }
    else
    {
hu's avatar
hu committed
294
        SEG_LED_FOUR_MUL_FOUR_T(0);
295 296 297 298
    }
}

/******************************************************************************
hu's avatar
hu committed
299
  T4 EXH BRAKE
hu's avatar
hu committed
300
  信号接口: 0x18FF2300 Byte:2,bit:2-1==00(B)
301
  信号定义:
hu's avatar
hu committed
302
  输出信号:
303
 ******************************************************************************/
hu's avatar
hu committed
304 305 306 307
uint8_t LED_EXH_BRAKE_T_Judgement(void)
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
308

hu's avatar
hu committed
309
    m_Condition1 = (uint8_t)Get_ID_18FF2300_Sig_Exh_Lamp();
310

hu's avatar
hu committed
311
    if (m_Condition1 == 0x00u)
hu's avatar
hu committed
312 313 314 315 316 317 318
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }
319

hu's avatar
hu committed
320 321 322 323 324 325 326 327 328 329 330 331
    return u8Result;
}
void LED_EXH_BRAKE_T_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL34 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL34 = 0x00;
    }
332

hu's avatar
hu committed
333 334 335 336 337 338 339 340 341
    if (led_status == 1)
    {
        SEG_LED_EXH_BRAKE_T(7);
    }
    else
    {
        SEG_LED_EXH_BRAKE_T(0);
    }
}
342 343

/******************************************************************************
hu's avatar
hu committed
344
  T5 QOS(GLOW)
hu's avatar
hu committed
345
  信号接口: 0x18FF2300 Byte:2,bit:6-5==01(B)
346
  信号定义:
hu's avatar
hu committed
347
  输出信号:
348
 ******************************************************************************/
hu's avatar
hu committed
349
uint8_t LED_QOS_GLOW_T_Judgement(void)
350 351 352
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
353

hu's avatar
hu committed
354
    m_Condition1 = (uint8_t)Get_ID_18FF2300_Sig_Glow_Lamp();
355 356 357 358 359 360 361 362 363 364 365 366

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
367
void LED_QOS_GLOW_T_Execution(uint8_t led_status)
368
{
hu's avatar
hu committed
369 370 371 372 373 374 375 376
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL33 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL33 = 0x00;
    }
377 378 379

    if (led_status == 1)
    {
hu's avatar
hu committed
380
        SEG_LED_QOS_GLOW_T(7);
381 382 383
    }
    else
    {
hu's avatar
hu committed
384
        SEG_LED_QOS_GLOW_T(0);
385 386 387
    }
}
/******************************************************************************
hu's avatar
hu committed
388
  T6 HI BEAM
hu's avatar
hu committed
389
  信号接口: A25  HIGH
390 391 392
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
393
uint8_t LED_HI_BEAM_T_Judgement(void)
hu's avatar
hu committed
394 395 396
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
397

hu's avatar
hu committed
398
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_HI_BEAM);
hu's avatar
hu committed
399 400 401 402 403 404 405 406 407 408 409 410

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
void LED_HI_BEAM_T_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL32 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL32 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_HI_BEAM_T(7);
    }
    else
    {
        SEG_LED_HI_BEAM_T(0);
    }
}
hu's avatar
hu committed
431

hu's avatar
hu committed
432 433
/******************************************************************************
  T7 Rr FOG LAMP
hu's avatar
hu committed
434
  信号接口: B14 HIGH
hu's avatar
hu committed
435 436 437 438
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_Rr_FOG_LAMP_T_Judgement(void)
hu's avatar
hu committed
439 440 441
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
442

hu's avatar
hu committed
443
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_Rr_FOG_LAMP);
hu's avatar
hu committed
444

hu's avatar
hu committed
445
    if (m_Condition1 == 1u)
hu's avatar
hu committed
446 447 448 449 450 451 452 453 454 455
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
456 457 458
void LED_Rr_FOG_LAMP_T_Execution(uint8_t led_status)
{
    T7_LED_OUT = led_status;
hu's avatar
hu committed
459

hu's avatar
hu committed
460 461 462 463 464 465 466 467 468 469 470 471
    if (led_status == 1)
    {
        SEG_LED_Rr_FOG_LAMP_T(7);
    }
    else
    {
        SEG_LED_Rr_FOG_LAMP_T(0);
    }
}

/******************************************************************************
  T8 MIL
hu's avatar
hu committed
472
  信号接口: A31 HIGH
hu's avatar
hu committed
473 474 475 476
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_MIL_T_Judgement(void)
hu's avatar
hu committed
477 478 479
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
480

hu's avatar
hu committed
481
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_MIL);
hu's avatar
hu committed
482 483 484

    if (m_Condition1 == 1u)
    {
hu's avatar
hu committed
485
        u8Result = 1u;
hu's avatar
hu committed
486 487 488
    }
    else
    {
hu's avatar
hu committed
489
        u8Result = 0u;
hu's avatar
hu committed
490 491 492 493
    }

    return u8Result;
}
hu's avatar
hu committed
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
void LED_MIL_T_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL31 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL31 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_MIL_T(7);
    }
    else
    {
        SEG_LED_MIL_T(0);
    }
}
hu's avatar
hu committed
514

hu's avatar
hu committed
515 516
/******************************************************************************
  T9 SVS
hu's avatar
hu committed
517
  信号接口: 0x18FED900 Byte:5,bit:8-7==01(B)
hu's avatar
hu committed
518 519 520 521
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_SVS_T_Judgement(void)
hu's avatar
hu committed
522 523 524
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
525

hu's avatar
hu committed
526
    m_Condition1 = (uint8_t)Get_ID_18FED900_Sig_SVS_Lamp_Status();
hu's avatar
hu committed
527 528 529 530 531 532 533 534 535 536 537 538

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
void LED_SVS_T_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL30 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL30 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_SVS_T(7);
    }
    else
    {
        SEG_LED_SVS_T(0);
    }
}
hu's avatar
hu committed
559

hu's avatar
hu committed
560 561 562 563 564 565 566
/******************************************************************************
  T10 H.S.A
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_H_S_A_T_Judgement(void)
hu's avatar
hu committed
567 568 569
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
570
    m_Condition1 = (uint8_t)XXXX;
hu's avatar
hu committed
571 572 573 574 575 576 577 578 579 580 581 582

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
583 584 585 586
void LED_H_S_A_T_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
hu's avatar
hu committed
587 588
        IS31_CHIP0_CHANNEL28 = LED_BRIGHTNESS;    /*绿灯 亮*/
        IS31_CHIP0_CHANNEL29 = 0x00;  /*黄灯 灭*/
hu's avatar
hu committed
589 590 591
    }
    else if (led_status == 2)
    {
hu's avatar
hu committed
592 593
        IS31_CHIP0_CHANNEL28 = 0x00;  /*绿灯 灭*/
        IS31_CHIP0_CHANNEL29 = LED_BRIGHTNESS;    /*黄灯 亮*/
hu's avatar
hu committed
594 595 596
    }
    else
    {
hu's avatar
hu committed
597 598
        IS31_CHIP0_CHANNEL28 = 0x00;  /*绿灯 灭*/
        IS31_CHIP0_CHANNEL29 = 0x00;  /*黄灯 灭*/
hu's avatar
hu committed
599
    }
hu's avatar
hu committed
600

hu's avatar
hu committed
601
    if (led_status != 0x00u)
hu's avatar
hu committed
602 603 604 605 606 607 608 609
    {
        SEG_LED_H_S_A_T(7);
    }
    else
    {
        SEG_LED_H_S_A_T(0);
    }
}
hu's avatar
hu committed
610

hu's avatar
hu committed
611 612
/******************************************************************************
  T11 RETARDER
hu's avatar
hu committed
613
  信号接口: 0x18FF5510 Byte:1,bit:1==01(B) 绿    ----  0x18FF5510  Byte1,Bit1 Byte:1,bit:1==10(B)  黄闪
hu's avatar
hu committed
614 615 616 617
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_RETARDER_T_Judgement(void)
hu's avatar
hu committed
618 619 620
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
621 622

    m_Condition1 = (uint8_t)Get_ID_18FF5510_Sig_Intarder_Pilot_Lamp_State();
hu's avatar
hu committed
623

hu's avatar
hu committed
624
    if (K_Line_Set.K_Line_LID41 == 0x13u)
hu's avatar
hu committed
625
    {
hu's avatar
hu committed
626
        if (m_Condition1 == 1u)
hu's avatar
hu committed
627
        {
hu's avatar
hu committed
628
            u8Result = 1u;
hu's avatar
hu committed
629
        }
hu's avatar
hu committed
630
        else if (m_Condition1 == 2u)
hu's avatar
hu committed
631
        {
hu's avatar
hu committed
632 633 634 635 636 637 638 639
            if (FLASH_SYNC_1Hz == 1u)
            {
                u8Result = 2u;
            }
            else
            {
                u8Result = 0u;
            }
hu's avatar
hu committed
640
        }
hu's avatar
hu committed
641 642 643
    }
    else
    {
hu's avatar
hu committed
644
        u8Result = 0u;
hu's avatar
hu committed
645 646 647 648
    }

    return u8Result;
}
hu's avatar
hu committed
649 650
void LED_RETARDER_T_Execution(uint8_t led_status)
{
hu's avatar
hu committed
651
    if (K_Line_Set.K_Line_LID41 == 0x13u)
hu's avatar
hu committed
652
    {
hu's avatar
hu committed
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677
        if (led_status == 1)
        {
            IS31_CHIP0_CHANNEL27 = LED_BRIGHTNESS; /* 绿灯 亮 */
            IS31_CHIP0_CHANNEL26 = 0x00u; /* 黄灯 灭 */
        }
        else if (led_status == 2)
        {
            IS31_CHIP0_CHANNEL27 = 0x00u; /* 绿灯 灭 */
            IS31_CHIP0_CHANNEL26 = LED_BRIGHTNESS; /* 黄灯 亮 闪 */
        }
        else
        {
            IS31_CHIP0_CHANNEL27 = 0x00u; /* 绿灯 灭 */
            IS31_CHIP0_CHANNEL26 = 0x00u; /* 黄灯 灭 */
        }

        if (led_status != 0x00u)
        {
            SEG_LED_RETARDER_T(7);
        }
        else
        {

            SEG_LED_RETARDER_T(0);
        }
hu's avatar
hu committed
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693
    }
    else
    {
        IS31_CHIP0_CHANNEL27 = 0x00; // 绿灯 灭
        IS31_CHIP0_CHANNEL26 = 0x00; // 黄灯 灭
        SEG_LED_RETARDER_T(0);
    }
}

/******************************************************************************
  T12 AUTO LEVELING
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_AUTO_LEVELING_T_Judgement(void)
hu's avatar
hu committed
694 695 696
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
697

hu's avatar
hu committed
698
    m_Condition1 = (uint8_t)XXXX;
hu's avatar
hu committed
699 700 701 702 703 704 705 706 707 708 709 710 711

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}

hu's avatar
hu committed
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
void LED_AUTO_LEVELING_T_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL25 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL25 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_AUTO_LEVELING_T(7);
    }
    else
    {
        SEG_LED_AUTO_LEVELING_T(0);
    }
}

/******************************************************************************
hu's avatar
hu committed
734
  L1 ROWS
hu's avatar
hu committed
735 736 737 738
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
739
uint8_t LED_ROWS_L_Judgement(void)
hu's avatar
hu committed
740 741 742
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
743

hu's avatar
hu committed
744
    m_Condition1 = (uint8_t)XXXX;
hu's avatar
hu committed
745 746 747 748 749 750 751 752 753 754 755 756

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
757
void LED_ROWS_L_Execution(uint8_t led_status)
hu's avatar
hu committed
758
{
hu's avatar
hu committed
759 760 761 762 763 764 765 766
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL01 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL01 = 0x00;
    }
hu's avatar
hu committed
767

hu's avatar
hu committed
768
    if (led_status == 1)
hu's avatar
hu committed
769
    {
hu's avatar
hu committed
770
        SEG_LED_ROWS_L(7);
hu's avatar
hu committed
771
    }
hu's avatar
hu committed
772
    else
hu's avatar
hu committed
773
    {
hu's avatar
hu committed
774
        SEG_LED_ROWS_L(0);
hu's avatar
hu committed
775 776 777 778
    }
}

/******************************************************************************
hu's avatar
hu committed
779
  L2 BSM OFF
hu's avatar
hu committed
780 781 782 783
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
784
uint8_t LED_BSM_OFF_L_Judgement(void)
hu's avatar
hu committed
785 786 787
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
788

hu's avatar
hu committed
789
    m_Condition1 = (uint8_t)XXXX;
hu's avatar
hu committed
790 791 792 793

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
hu's avatar
hu committed
794 795 796 797 798
    }
    else
    {
        u8Result = 0u;
    }
799

hu's avatar
hu committed
800 801
    return u8Result;
}
hu's avatar
hu committed
802
void LED_BSM_OFF_L_Execution(uint8_t led_status)
hu's avatar
hu committed
803
{
hu's avatar
hu committed
804 805 806 807 808 809 810 811
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL02 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL02 = 0x00;
    }
hu's avatar
hu committed
812

hu's avatar
hu committed
813
    if (led_status == 1)
hu's avatar
hu committed
814
    {
hu's avatar
hu committed
815
        SEG_LED_BSM_OFF_L(7);
hu's avatar
hu committed
816 817 818
    }
    else
    {
hu's avatar
hu committed
819
        SEG_LED_BSM_OFF_L(0);
hu's avatar
hu committed
820 821 822
    }
}

hu's avatar
hu committed
823
/******************************************************************************
hu's avatar
hu committed
824
  L3 AEBS OFF
hu's avatar
hu committed
825 826 827 828
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
829
uint8_t LED_AEBS_OFF_L_Judgement(void)
hu's avatar
hu committed
830 831 832
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
833 834
    uint8_t m_Condition2 = 0u;
    uint8_t m_Condition3 = 0u;
hu's avatar
hu committed
835

hu's avatar
hu committed
836 837 838 839
    m_Condition1 = (uint8_t)Get_ID_CF02F2A_Sig_Advanced_Emerg_Braking_Sys_Sta();
    m_Condition2 = (uint8_t)Get_ID_CF02FA1_Sig_Advanced_Emerg_Braking_Sys_Sta();
    m_Condition3 = (uint8_t)Get_ID_CF02FA0_Sig_Advanced_Emerg_Braking_Sys_Sta();

hu's avatar
hu committed
840
    if (K_Line_Set.K_Line_LID28 == 0x01u)
hu's avatar
hu committed
841
    {
hu's avatar
hu committed
842
        if ((m_Condition1 == 0x02u) || (m_Condition2 == 0x02u) || (m_Condition3 == 0x02u))
hu's avatar
hu committed
843 844 845
        {
            u8Result = 1u;
        }
hu's avatar
hu committed
846
        else if ((m_Condition1 == 0x0Eu) || (m_Condition2 == 0x0Eu) || (m_Condition3 == 0x0Eu))
hu's avatar
hu committed
847 848 849
        {
            u8Result = FLASH_SYNC_1Hz;
        }
hu's avatar
hu committed
850
    }
hu's avatar
hu committed
851 852 853 854 855 856 857
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
858
void LED_AEBS_OFF_L_Execution(uint8_t led_status)
hu's avatar
hu committed
859
{
hu's avatar
hu committed
860
    if (K_Line_Set.K_Line_LID28 == 0x01u)
hu's avatar
hu committed
861
    {
hu's avatar
hu committed
862 863 864 865 866 867 868 869
        if (led_status == 1)
        {
            IS31_CHIP0_CHANNEL03 = LED_BRIGHTNESS;
        }
        else
        {
            IS31_CHIP0_CHANNEL03 = 0x00;
        }
hu's avatar
hu committed
870

hu's avatar
hu committed
871 872 873 874 875 876 877 878 879

        if (led_status == 1)
        {
            SEG_LED_AEBS_OFF_L(7);
        }
        else
        {
            SEG_LED_AEBS_OFF_L(0);
        }
hu's avatar
hu committed
880 881 882
    }
    else
    {
hu's avatar
hu committed
883
        IS31_CHIP0_CHANNEL03 = 0x01u;
hu's avatar
hu committed
884 885
        SEG_LED_AEBS_OFF_L(0);
    }
hu's avatar
hu committed
886 887
}

hu's avatar
hu committed
888
/******************************************************************************
hu's avatar
hu committed
889
  L4 LDWS
hu's avatar
hu committed
890 891 892 893 894
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_LDWS_L_Judgement(void)
hu's avatar
hu committed
895 896 897 898
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
    uint8_t m_Condition2 = 0u;
hu's avatar
hu committed
899 900
    uint8_t CanStatus1 = 0u;
    uint8_t CanStatus2 = 0u;
hu's avatar
hu committed
901

hu's avatar
hu committed
902 903
    m_Condition1 = (uint8_t)Get_ID_18FE5BE8_Sig_Lane_Departure_Warning_Sys_Sta();
    m_Condition2 = (uint8_t)Get_ID_18FECAE8_Sig_Amber_Warning_Lamp_Status();
hu's avatar
hu committed
904

hu's avatar
hu committed
905 906 907 908
    CanStatus1 = CAN_MSG_Status(ID_CanMsg18FE5BE8_Msg_Count);
    CanStatus2 = CAN_MSG_Status(ID_CanMsg18FECAE8_Msg_Count);

    if (K_Line_Set.K_Line_LID27 == 0x01u)
hu's avatar
hu committed
909
    {
hu's avatar
hu committed
910 911 912 913 914 915 916 917 918 919 920 921 922
        /*LDWS与FCW同时掉线闪烁*/
        if ((CanStatus1 == CAN_SIG_LOST) && (CanStatus2 == CAN_SIG_LOST))
        {
            u8Result = FLASH_SYNC_1Hz;
        }
        else if ((m_Condition1 == 0x02u) || (m_Condition2 == 0x01u))
        {
            u8Result = 1u;
        }
        else if ((m_Condition1 == 0x00u) || (m_Condition1 == 0x05u) || (m_Condition1 == 0x0Eu))
        {
            u8Result = FLASH_SYNC_1Hz;
        }
hu's avatar
hu committed
923 924 925 926 927 928 929 930
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
931
void LED_LDWS_L_Execution(uint8_t led_status)
hu's avatar
hu committed
932
{
hu's avatar
hu committed
933

hu's avatar
hu committed
934
    if (K_Line_Set.K_Line_LID28 == 0x01u)
hu's avatar
hu committed
935
    {
hu's avatar
hu committed
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
        if (led_status == 1)
        {
            IS31_CHIP0_CHANNEL04 = LED_BRIGHTNESS;
        }
        else
        {
            IS31_CHIP0_CHANNEL04 = 0x00;
        }

        if (led_status == 1)
        {
            SEG_LED_LDWS_L(7);
        }
        else
        {
            SEG_LED_LDWS_L(0);
        }
hu's avatar
hu committed
953 954 955
    }
    else
    {
hu's avatar
hu committed
956
        IS31_CHIP0_CHANNEL04 = 0x00u;
hu's avatar
hu committed
957
        SEG_LED_LDWS_L(0);
hu's avatar
hu committed
958 959 960
    }
}

hu's avatar
hu committed
961
/******************************************************************************
hu's avatar
hu committed
962
  L5 SRS
hu's avatar
hu committed
963 964 965 966
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
967 968 969 970
uint8_t LED_SRS_L_Judgement(void)
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
971

hu's avatar
hu committed
972 973 974 975 976 977 978 979 980 981 982 983 984
    m_Condition1 = (uint8_t)XXXX;

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004
void LED_SRS_L_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL20 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL20 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_SRS_L(7);
    }
    else
    {
        SEG_LED_SRS_L(0);
    }
}
hu's avatar
hu committed
1005

hu's avatar
hu committed
1006
/******************************************************************************
hu's avatar
hu committed
1007
  L6 ENG OIL
hu's avatar
hu committed
1008
  信号接口: A32 LOW
hu's avatar
hu committed
1009 1010 1011 1012
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_ENG_OIL_L_Judgement(void)
hu's avatar
hu committed
1013 1014 1015
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1016

hu's avatar
hu committed
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_ENG_OIL);

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
void LED_ENG_OIL_L_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL21 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL21 = 0x00;
    }
hu's avatar
hu committed
1040

hu's avatar
hu committed
1041 1042 1043 1044 1045 1046 1047 1048 1049
    if (led_status == 1)
    {
        SEG_LED_ENG_OIL_L(7);
    }
    else
    {
        SEG_LED_ENG_OIL_L(0);
    }
}
hu's avatar
hu committed
1050

hu's avatar
hu committed
1051
/******************************************************************************
hu's avatar
hu committed
1052
  L7 CHARG
hu's avatar
hu committed
1053
  信号接口: A34 LOW
hu's avatar
hu committed
1054 1055 1056 1057
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_CHARG_L_Judgement(void)
hu's avatar
hu committed
1058 1059 1060
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1061

hu's avatar
hu committed
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_CHARGE);

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094
void LED_CHARG_L_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL22 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL22 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_CHARG_L(7);
    }
    else
    {
        SEG_LED_CHARG_L(0);
    }
}
hu's avatar
hu committed
1095

hu's avatar
hu committed
1096
/******************************************************************************
hu's avatar
hu committed
1097
  L8 SEAT BELT
hu's avatar
hu committed
1098
  信号接口: A30 LOW
hu's avatar
hu committed
1099 1100 1101 1102
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_SEAT_BELT_L_Judgement(void)
hu's avatar
hu committed
1103 1104 1105
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1106

hu's avatar
hu committed
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_SEAT_BELT);

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129
void LED_SEAT_BELT_L_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL23 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL23 = 0x00;
    }
hu's avatar
hu committed
1130

hu's avatar
hu committed
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140
    if (led_status == 1)
    {
        SEG_LED_SEAT_BELT_L(7);
    }
    else
    {
        SEG_LED_SEAT_BELT_L(0);
    }
}
/******************************************************************************
hu's avatar
hu committed
1141
  L9 RR DIFF LOCK
hu's avatar
hu committed
1142 1143 1144 1145 1146
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_RR_DIFF_LOCK_L_Judgement(void)
hu's avatar
hu committed
1147 1148 1149
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1150 1151

    m_Condition1 = XXXX;
hu's avatar
hu committed
1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183
void LED_RR_DIFF_LOCK_L_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL16 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL16 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_RR_DIFF_LOCK_L(7);
    }
    else
    {
        SEG_LED_RR_DIFF_LOCK_L(0);
    }
}
hu's avatar
hu committed
1184

hu's avatar
hu committed
1185
/******************************************************************************
hu's avatar
hu committed
1186
  L10 TPMS
hu's avatar
hu committed
1187 1188 1189 1190 1191
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_TPMS_L_Judgement(void)
hu's avatar
hu committed
1192 1193
{
    uint8_t u8Result = 0u;
hu's avatar
hu committed
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206
    uint8_t CanStatus1 = 0x00u;
    uint8_t Low_Presure = 0u;
    uint8_t High_Presure = 0u;
    uint8_t High_Temperature = 0u;
    uint8_t No_signal = 0u;
    uint8_t Sensor_fault = 0u;

    Low_Presure = (uint8_t)Get_TPMSLow_Presure_Sta();
    High_Presure = (uint8_t)Get_TPMSHigh_Presure_Sta();
    High_Temperature = (uint8_t)Get_TPMSHigh_Temperature_Sta();
    No_signal = (uint8_t)Get_TPMSNo_signal_Sta();
    Sensor_fault = (uint8_t)Get_TPMSSensor_fault_Sta();
    CanStatus1 = CAN_MSG_Status(ID_CanMsg18011733_Msg_Count);
hu's avatar
hu committed
1207

hu's avatar
hu committed
1208
    if (K_Line_Set.K_Line_LID3E == 0x01u)
hu's avatar
hu committed
1209
    {
hu's avatar
hu committed
1210
        if ((Low_Presure == 1u) || (High_Presure == 1u) || (High_Temperature == 1u))
hu's avatar
hu committed
1211 1212 1213
        {
            u8Result = 1u;
        }
hu's avatar
hu committed
1214
        else if ((No_signal == 1u) || (Sensor_fault == 1u) || (CanStatus1 == CAN_SIG_LOST))
hu's avatar
hu committed
1215 1216 1217 1218 1219 1220 1221
        {
            u8Result = FLASH_SYNC_1Hz;
        }
        else
        {
            u8Result = 0u;
        }
hu's avatar
hu committed
1222 1223 1224 1225 1226 1227 1228 1229
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1230 1231
void LED_TPMS_L_Execution(uint8_t led_status)
{
hu's avatar
hu committed
1232
    if (K_Line_Set.K_Line_LID3E == 0x01u)
hu's avatar
hu committed
1233
    {
hu's avatar
hu committed
1234 1235 1236 1237 1238 1239 1240 1241
        if (led_status == 1)
        {
            IS31_CHIP0_CHANNEL17 = LED_BRIGHTNESS;
        }
        else
        {
            IS31_CHIP0_CHANNEL17 = 0x00;
        }
hu's avatar
hu committed
1242

hu's avatar
hu committed
1243 1244 1245 1246 1247 1248 1249 1250
        if (led_status == 1)
        {
            SEG_LED_TPMS_L(7);
        }
        else
        {
            SEG_LED_TPMS_L(0);
        }
hu's avatar
hu committed
1251 1252 1253
    }
    else
    {
hu's avatar
hu committed
1254
        IS31_CHIP0_CHANNEL17 = 0x00u;
hu's avatar
hu committed
1255 1256 1257 1258
        SEG_LED_TPMS_L(0);
    }
}
/******************************************************************************
hu's avatar
hu committed
1259
  L11 ASR/EVSC OFF
hu's avatar
hu committed
1260
  信号接口: 18F0010B Byte:3 Bit:3-4==01(B)
hu's avatar
hu committed
1261 1262
  信号定义:
  输出信号:
hu's avatar
hu committed
1263
  说明:调整依据 SXS-VC66-22_EBS WARNING & INDICATOR (7“LCD)改訂1-1_20211116
hu's avatar
hu committed
1264 1265
 ******************************************************************************/
uint8_t LED_ASR_or_EVSC_OFF_L_Judgement(void)
hu's avatar
hu committed
1266 1267 1268
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1269

hu's avatar
hu committed
1270 1271
    m_Condition1 = (uint8_t)Get_ID_18F0010B_Sig_ASR_Offroad_Switch();

hu's avatar
hu committed
1272
    if (K_Line_Set.K_Line_LID22 == 0x01u)
hu's avatar
hu committed
1273
    {
hu's avatar
hu committed
1274 1275 1276 1277 1278 1279 1280 1281
        if (m_Condition1 == 1u)
        {
            u8Result = 1u;
        }
        else
        {
            u8Result = 0u;
        }
hu's avatar
hu committed
1282 1283 1284 1285 1286 1287 1288 1289
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1290 1291
void LED_ASR_or_EVSC_OFF_L_Execution(uint8_t led_status)
{
hu's avatar
hu committed
1292
    if (K_Line_Set.K_Line_LID22 == 0x01u)
hu's avatar
hu committed
1293
    {
hu's avatar
hu committed
1294 1295 1296 1297 1298 1299 1300 1301
        if (led_status == 1)
        {
            IS31_CHIP0_CHANNEL18 = LED_BRIGHTNESS;
        }
        else
        {
            IS31_CHIP0_CHANNEL18 = 0x00;
        }
hu's avatar
hu committed
1302

hu's avatar
hu committed
1303 1304 1305 1306 1307 1308 1309 1310
        if (led_status == 1)
        {
            SEG_LED_ASR_or_EVSC_OFF_L(7);
        }
        else
        {
            SEG_LED_ASR_or_EVSC_OFF_L(0);
        }
hu's avatar
hu committed
1311 1312 1313
    }
    else
    {
hu's avatar
hu committed
1314
        IS31_CHIP0_CHANNEL18 = 0x0u;
hu's avatar
hu committed
1315 1316 1317
        SEG_LED_ASR_or_EVSC_OFF_L(0);
    }
}
hu's avatar
hu committed
1318

hu's avatar
hu committed
1319
/******************************************************************************
hu's avatar
hu committed
1320
  L12 EVSC
hu's avatar
hu committed
1321 1322 1323
  信号接口:
  信号定义:
  输出信号:
hu's avatar
hu committed
1324
  调整依据:SXS-VC66-22_EBS WARNING & INDICATOR (7“LCD)改訂1-1_20211116
hu's avatar
hu committed
1325 1326
 ******************************************************************************/
uint8_t LED_EVSC_L_Judgement(void)
hu's avatar
hu committed
1327 1328
{
    uint8_t u8Result = 0u;
hu's avatar
hu committed
1329 1330
    uint8_t CanStatus1 = 0u;
    uint8_t CanStatus2 = 0u;
hu's avatar
hu committed
1331 1332 1333 1334 1335
    uint8_t m_Condition1 = 0u;
    uint8_t m_Condition2 = 0u;
    uint8_t m_Condition3 = 0u;
    uint8_t m_Condition4 = 0u;
    uint8_t m_Condition5 = 0u;
hu's avatar
hu committed
1336 1337
    uint16_t m_Condition6 = 0u;
    uint16_t m_Condition7 = 0u;
hu's avatar
hu committed
1338

hu's avatar
hu committed
1339 1340 1341
    CanStatus1 = CAN_MSG_Status(ID_CanMsg18FE4F0B_Msg_Count);
    CanStatus2 = CAN_MSG_Status(ID_CanMsg18F0010B_Msg_Count);
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_BRAKE_AIR_EBS); /*A28*/
hu's avatar
hu committed
1342
    m_Condition2 = (uint8_t)Get_ID_18F0010B_Sig_EBS_Red_Warning_Lamp_State(); /*byte6 34*/
hu's avatar
hu committed
1343 1344 1345
    m_Condition3 = (uint8_t)Get_ID_18F0010B_Sig_ATC_or_ASR_Lamp_State();
    m_Condition4 = (uint8_t)Get_ID_18FE4F0B_Sig_VDC_Lamp_State();
    m_Condition5 = (uint8_t)Get_ID_18FE4F0B_Sig_VDC_Fully_operational();
hu's avatar
hu committed
1346 1347 1348 1349 1350
    m_Condition6 = Common_Get_Air1_Data();  /*气压1 1.89以下*/
    m_Condition7 = Common_Get_Air2_Data();  /*气压1 1.89以下*/

    /*做个回差,去抖*/
    if ((m_Condition6 < 1890u) || (m_Condition7 < 1890u))
hu's avatar
hu committed
1351
    {
hu's avatar
hu committed
1352
        L12_Air_Sta  = 1u;
hu's avatar
hu committed
1353
    }
hu's avatar
hu committed
1354
    else if ((m_Condition6 >= 1990u) && (m_Condition7 >= 1990u))
hu's avatar
hu committed
1355
    {
hu's avatar
hu committed
1356
        L12_Air_Sta = 0u;
hu's avatar
hu committed
1357
    }
hu's avatar
hu committed
1358 1359

    if (
hu's avatar
hu committed
1360
        (m_Condition1 == 1u) || (Common_Get_L12_Air_Sta() == 1u) ||
hu's avatar
hu committed
1361 1362
        (((m_Condition2 == 1u) || (CanStatus2 == CAN_SIG_LOST)) && (K_Line_Set.K_Line_LID21 == 0x01u)) ||
        (((m_Condition5 == 0u) || (CanStatus1 == CAN_SIG_LOST)) && (K_Line_Set.K_Line_LID22 == 0x01u))
hu's avatar
hu committed
1363
    )
hu's avatar
hu committed
1364
    {
hu's avatar
hu committed
1365
        u8Result = 1u;
hu's avatar
hu committed
1366
    }
hu's avatar
hu committed
1367 1368
    else if (((m_Condition3 == 1u) && (K_Line_Set.K_Line_LID21 == 0x01u)) ||
             ((m_Condition4 == 1u) && (K_Line_Set.K_Line_LID22 == 0x01u)))
hu's avatar
hu committed
1369
    {
hu's avatar
hu committed
1370
        u8Result = FLASH_SYNC_2Hz;
hu's avatar
hu committed
1371
    }
hu's avatar
hu committed
1372 1373 1374 1375 1376 1377 1378
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1379
void LED_EVSC_L_Execution(uint8_t led_status)
hu's avatar
hu committed
1380
{
hu's avatar
hu committed
1381
    if (led_status == 1)
hu's avatar
hu committed
1382
    {
hu's avatar
hu committed
1383
        IS31_CHIP0_CHANNEL19 = LED_BRIGHTNESS;
hu's avatar
hu committed
1384 1385 1386
    }
    else
    {
hu's avatar
hu committed
1387
        IS31_CHIP0_CHANNEL19 = 0x00;
hu's avatar
hu committed
1388 1389
    }

hu's avatar
hu committed
1390
    if (led_status == 1)
hu's avatar
hu committed
1391
    {
hu's avatar
hu committed
1392
        SEG_LED_EVSC_L(7);
hu's avatar
hu committed
1393 1394 1395
    }
    else
    {
hu's avatar
hu committed
1396
        SEG_LED_EVSC_L(0);
hu's avatar
hu committed
1397 1398 1399
    }
}

hu's avatar
hu committed
1400
/******************************************************************************
hu's avatar
hu committed
1401
  L13 ECO STOP OFF
hu's avatar
hu committed
1402 1403 1404 1405 1406
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_eco_stop_OFF_L_Judgement(void)
hu's avatar
hu committed
1407 1408 1409
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1410
    m_Condition1 = (uint8_t)XXXX;
hu's avatar
hu committed
1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1423
void LED_eco_stop_OFF_L_Execution(uint8_t led_status)
hu's avatar
hu committed
1424
{
hu's avatar
hu committed
1425
    if (led_status == 1)
hu's avatar
hu committed
1426
    {
hu's avatar
hu committed
1427 1428
        IS31_CHIP0_CHANNEL12 = LED_BRIGHTNESS;  /* 绿灯 亮 */
        IS31_CHIP0_CHANNEL13 = 0x00u;  /* 黄灯 灭 */
hu's avatar
hu committed
1429
    }
hu's avatar
hu committed
1430
    else if (led_status == 2)
hu's avatar
hu committed
1431
    {
hu's avatar
hu committed
1432 1433
        IS31_CHIP0_CHANNEL12 = 0x00u;  /* 绿灯 灭 */
        IS31_CHIP0_CHANNEL13 = LED_BRIGHTNESS;  /* 黄灯 亮 */
hu's avatar
hu committed
1434 1435 1436
    }
    else
    {
hu's avatar
hu committed
1437 1438
        IS31_CHIP0_CHANNEL12 = 0x00u;  /* 绿灯 灭 */
        IS31_CHIP0_CHANNEL13 = 0x00u;  /* 黄灯 灭 */
hu's avatar
hu committed
1439 1440
    }

hu's avatar
hu committed
1441
    if ((led_status == 1) || (led_status == 2))
hu's avatar
hu committed
1442
    {
hu's avatar
hu committed
1443
        SEG_LED_eco_stop_OFF_L(7);
hu's avatar
hu committed
1444 1445 1446
    }
    else
    {
hu's avatar
hu committed
1447
        SEG_LED_eco_stop_OFF_L(0);
hu's avatar
hu committed
1448 1449 1450
    }
}

hu's avatar
hu committed
1451
/******************************************************************************
hu's avatar
hu committed
1452
  L14 AMT
hu's avatar
hu committed
1453
  信号接口:  无多包处理 /18EBFF03/18ECFF03  PGN:65226 DM1
hu's avatar
hu committed
1454 1455 1456 1457
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_AMT_L_Judgement(void)
hu's avatar
hu committed
1458 1459 1460 1461 1462
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
    uint8_t m_Condition2 = 0u;
    uint8_t m_Condition3 = 0u;
hu's avatar
hu committed
1463 1464 1465
    uint8_t m_Condition4 = 0u;
    uint8_t m_Condition5 = 0u;
    uint8_t m_Condition6 = 0u;
hu's avatar
hu committed
1466

hu's avatar
hu committed
1467 1468
    m_Condition1 = (uint8_t)Get_ID_18FECA03_Sig_Amber_Warning_Lamp_Status();
    m_Condition2 = (uint8_t)Get_ID_18FECA03_Sig_Malfunction_indicator_Lamp();
hu's avatar
hu committed
1469

hu's avatar
hu committed
1470
    if (K_Line_Set.K_Line_LID41 == 0x13u)
hu's avatar
hu committed
1471
    {
hu's avatar
hu committed
1472 1473 1474 1475 1476 1477 1478 1479
        if ((m_Condition1 == 1u) || (m_Condition2 == 1u))
        {
            u8Result = 1u;
        }
        else
        {
            u8Result = 0u;
        }
hu's avatar
hu committed
1480 1481 1482 1483 1484 1485 1486 1487
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1488
void LED_AMT_L_Execution(uint8_t led_status)
hu's avatar
hu committed
1489
{
hu's avatar
hu committed
1490
    if (K_Line_Set.K_Line_LID41 == 0x13u)
hu's avatar
hu committed
1491
    {
hu's avatar
hu committed
1492 1493 1494 1495 1496 1497 1498 1499
        if (led_status == 1)
        {
            IS31_CHIP0_CHANNEL14 = LED_BRIGHTNESS;
        }
        else
        {
            IS31_CHIP0_CHANNEL14 = 0x00;
        }
hu's avatar
hu committed
1500

hu's avatar
hu committed
1501 1502 1503 1504 1505 1506 1507 1508
        if (led_status == 1)
        {
            SEG_LED_AMT_L(7);
        }
        else
        {
            SEG_LED_AMT_L(0);
        }
hu's avatar
hu committed
1509 1510 1511
    }
    else
    {
hu's avatar
hu committed
1512
        IS31_CHIP0_CHANNEL14 = 0x00u;
hu's avatar
hu committed
1513
        SEG_LED_AMT_L(0);
hu's avatar
hu committed
1514 1515 1516
    }
}

hu's avatar
hu committed
1517
/******************************************************************************
hu's avatar
hu committed
1518
  L15 WEAR IND
hu's avatar
hu committed
1519
  信号接口: B38 0V B40 0V
hu's avatar
hu committed
1520 1521 1522 1523
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_WEAR_IND_L_Judgement(void)
hu's avatar
hu committed
1524 1525 1526
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1527 1528
    uint8_t m_Condition2 = 0u;

hu's avatar
hu committed
1529
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_WEAR_IND);
hu's avatar
hu committed
1530
    m_Condition2 = (uint8_t)Line_In_Get_Status(LINE_IN_WEAR2);
hu's avatar
hu committed
1531

hu's avatar
hu committed
1532
    if ((m_Condition1 == 1u) || (m_Condition2 == 0x01u))
hu's avatar
hu committed
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1543
void LED_WEAR_IND_L_Execution(uint8_t led_status)
hu's avatar
hu committed
1544 1545 1546
{
    if (led_status == 1)
    {
hu's avatar
hu committed
1547
        IS31_CHIP0_CHANNEL15 = LED_BRIGHTNESS;
hu's avatar
hu committed
1548 1549 1550
    }
    else
    {
hu's avatar
hu committed
1551
        IS31_CHIP0_CHANNEL15 = 0x00;
hu's avatar
hu committed
1552 1553 1554 1555
    }

    if (led_status == 1)
    {
hu's avatar
hu committed
1556
        SEG_LED_WEAR_IND_L(7);
hu's avatar
hu committed
1557 1558 1559
    }
    else
    {
hu's avatar
hu committed
1560
        SEG_LED_WEAR_IND_L(0);
hu's avatar
hu committed
1561 1562 1563
    }
}

hu's avatar
hu committed
1564
/******************************************************************************
hu's avatar
hu committed
1565
 R1 PARK BRAKE
hu's avatar
hu committed
1566
 信号接口: A23 GND
hu's avatar
hu committed
1567 1568 1569 1570
 信号定义:
 输出信号:
******************************************************************************/
uint8_t LED_PARK_BRAKE_R_Judgement(void)
hu's avatar
hu committed
1571
{
hu's avatar
hu committed
1572 1573
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1574
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_PARK_BRAKE);
hu's avatar
hu committed
1575

hu's avatar
hu committed
1576
    if (m_Condition1 == 1u)
hu's avatar
hu committed
1577
    {
hu's avatar
hu committed
1578
        u8Result = 1u;
hu's avatar
hu committed
1579 1580 1581
    }
    else
    {
hu's avatar
hu committed
1582
        u8Result = 0u;
hu's avatar
hu committed
1583 1584
    }

hu's avatar
hu committed
1585 1586
    return u8Result;
}
hu's avatar
hu committed
1587
void LED_PARK_BRAKE_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1588 1589 1590
{
    if (led_status == 1)
    {
hu's avatar
hu committed
1591
        IS31_CHIP0_CHANNEL08 = LED_BRIGHTNESS;
hu's avatar
hu committed
1592 1593 1594
    }
    else
    {
hu's avatar
hu committed
1595
        IS31_CHIP0_CHANNEL08 = 0x00;
hu's avatar
hu committed
1596 1597 1598 1599
    }

    if (led_status == 1)
    {
hu's avatar
hu committed
1600
        SEG_LED_PARK_BRAKE_R(7);
hu's avatar
hu committed
1601 1602 1603
    }
    else
    {
hu's avatar
hu committed
1604
        SEG_LED_PARK_BRAKE_R(0);
hu's avatar
hu committed
1605 1606 1607
    }
}

hu's avatar
hu committed
1608
/******************************************************************************
hu's avatar
hu committed
1609
  R2 BRAKE AIR/EBS
hu's avatar
hu committed
1610 1611 1612 1613
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
1614
uint8_t LED_BRAKE_AIR_or_EBS_RED_R_Judgement(void)
hu's avatar
hu committed
1615 1616
{
    uint8_t u8Result = 0u;
hu's avatar
hu committed
1617
    uint8_t CanStatus = 0u;
hu's avatar
hu committed
1618
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1619
    uint8_t m_Condition3 = 0u;
hu's avatar
hu committed
1620

hu's avatar
hu committed
1621 1622 1623
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_BRAKE_AIR_EBS);
    m_Condition3 = (uint8_t)Get_ID_18F0010B_Sig_EBS_Red_Warning_Lamp_State();

hu's avatar
hu committed
1624 1625
    CanStatus = CAN_MSG_Status(ID_CanMsg18F0010B_Msg_Count);

hu's avatar
hu committed
1626
    if ((m_Condition1 == 0x01u) || (Common_Get_L12_Air_Sta() == 0x01u) ||
hu's avatar
hu committed
1627
            ((K_Line_Set.K_Line_LID21 == 0x01u) && ((m_Condition3 == 1u) || (CanStatus == CAN_SIG_LOST))))
hu's avatar
hu committed
1628
    {
hu's avatar
hu committed
1629
        u8Result = 1u;
hu's avatar
hu committed
1630 1631 1632 1633 1634 1635 1636 1637
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1638
void LED_BRAKE_AIR_or_EBS_RED_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1639
{
hu's avatar
hu committed
1640
    BRAKE_AIR_EBS_LED_MCU = led_status;
hu's avatar
hu committed
1641 1642 1643

    if (led_status == 1)
    {
hu's avatar
hu committed
1644
        SEG_LED_BRAKE_AIR_or_EBS_RED_R(7);
hu's avatar
hu committed
1645 1646 1647
    }
    else
    {
hu's avatar
hu committed
1648
        SEG_LED_BRAKE_AIR_or_EBS_RED_R(0);
hu's avatar
hu committed
1649 1650 1651
    }
}

hu's avatar
hu committed
1652
/******************************************************************************
hu's avatar
hu committed
1653
  R3 BRAKE LOCK
hu's avatar
hu committed
1654 1655
  信号接口:
  信号定义:
hu's avatar
hu committed
1656
  输出信号:
hu's avatar
hu committed
1657
 ******************************************************************************/
hu's avatar
hu committed
1658
uint8_t LED_BRAKE_LOCK_R_Judgement(void)
hu's avatar
hu committed
1659 1660 1661
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1662

hu's avatar
hu committed
1663
    m_Condition1 = (uint8_t)XXXX;
hu's avatar
hu committed
1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1676
void LED_BRAKE_LOCK_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1677
{
hu's avatar
hu committed
1678 1679 1680 1681 1682 1683 1684 1685
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL07 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL07 = 0x00;
    }
hu's avatar
hu committed
1686 1687 1688

    if (led_status == 1)
    {
hu's avatar
hu committed
1689
        SEG_LED_BRAKE_LOCK_R(7);
hu's avatar
hu committed
1690 1691 1692
    }
    else
    {
hu's avatar
hu committed
1693
        SEG_LED_BRAKE_LOCK_R(0);
hu's avatar
hu committed
1694 1695
    }
}
hu's avatar
hu committed
1696

hu's avatar
hu committed
1697
/******************************************************************************
hu's avatar
hu committed
1698
  R4 AIR SUS
hu's avatar
hu committed
1699 1700 1701 1702
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
1703
uint8_t LED_AIR_SUS_R_Judgement(void)
hu's avatar
hu committed
1704 1705 1706
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1707

hu's avatar
hu committed
1708
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_AIR_SUS);
hu's avatar
hu committed
1709

hu's avatar
hu committed
1710
    if (m_Condition1 == 1u)
hu's avatar
hu committed
1711 1712 1713 1714 1715 1716 1717
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }
hu's avatar
hu committed
1718

hu's avatar
hu committed
1719 1720
    return u8Result;
}
hu's avatar
hu committed
1721
void LED_AIR_SUS_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1722
{
hu's avatar
hu committed
1723 1724 1725 1726 1727 1728 1729 1730
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL06 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL06 = 0x00;
    }
hu's avatar
hu committed
1731 1732 1733

    if (led_status == 1)
    {
hu's avatar
hu committed
1734
        SEG_LED_AIR_SUS_R(7);
hu's avatar
hu committed
1735 1736 1737
    }
    else
    {
hu's avatar
hu committed
1738
        SEG_LED_AIR_SUS_R(0);
hu's avatar
hu committed
1739 1740 1741
    }
}

hu's avatar
hu committed
1742
/******************************************************************************
hu's avatar
hu committed
1743 1744 1745 1746 1747 1748
  R5 TRAILER BRAKE
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_TRAILER_BRAKE_R_Judgement(void)
hu's avatar
hu committed
1749 1750 1751
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1752

hu's avatar
hu committed
1753
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_TRAILER_BRAKE);
hu's avatar
hu committed
1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1766
void LED_TRAILER_BRAKE_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1767 1768 1769
{
    if (led_status == 1)
    {
hu's avatar
hu committed
1770
        IS31_CHIP0_CHANNEL10 = LED_BRIGHTNESS;
hu's avatar
hu committed
1771 1772 1773
    }
    else
    {
hu's avatar
hu committed
1774
        IS31_CHIP0_CHANNEL10 = 0x00;
hu's avatar
hu committed
1775 1776 1777 1778
    }

    if (led_status == 1)
    {
hu's avatar
hu committed
1779
        SEG_LED_TRAILER_BRAKE_R(7);
hu's avatar
hu committed
1780 1781 1782
    }
    else
    {
hu's avatar
hu committed
1783
        SEG_LED_TRAILER_BRAKE_R(0);
hu's avatar
hu committed
1784 1785 1786
    }
}

hu's avatar
hu committed
1787
/******************************************************************************
hu's avatar
hu committed
1788
  R6 BRAKE AIR/EBS
hu's avatar
hu committed
1789 1790 1791 1792
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
1793
uint8_t LED_BRAKE_AIR_or_EBS_YELLOW_R_Judgement(void)
hu's avatar
hu committed
1794 1795 1796
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1797 1798

    //m_Condition1 = (uint8_t)Get_ID_18F0010B_Sig_EBS_Amber_Warning_State();
hu's avatar
hu committed
1799

hu's avatar
hu committed
1800
    if (m_Condition1 == 1u)
hu's avatar
hu committed
1801
    {
hu's avatar
hu committed
1802
        u8Result = 0u;
hu's avatar
hu committed
1803 1804 1805 1806 1807 1808 1809 1810
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1811
void LED_BRAKE_AIR_or_EBS_YELLOW_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1812
{
hu's avatar
hu committed
1813 1814 1815 1816 1817 1818 1819 1820
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL09 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL09 = 0x00;
    }
hu's avatar
hu committed
1821 1822 1823

    if (led_status == 1)
    {
hu's avatar
hu committed
1824
        SEG_LED_BRAKE_AIR_or_EBS_YELLOW_R(7);
hu's avatar
hu committed
1825 1826 1827
    }
    else
    {
hu's avatar
hu committed
1828
        SEG_LED_BRAKE_AIR_or_EBS_YELLOW_R(0);
hu's avatar
hu committed
1829 1830 1831
    }
}

hu's avatar
hu committed
1832
/******************************************************************************
hu's avatar
hu committed
1833
  R7  ACC AIR
hu's avatar
hu committed
1834 1835
  信号接口:
  信号定义:
hu's avatar
hu committed
1836
  输出信号: R6_LED_OUT
hu's avatar
hu committed
1837
 ******************************************************************************/
hu's avatar
hu committed
1838
uint8_t LED_ACC_AIR_R_Judgement(void)
hu's avatar
hu committed
1839 1840 1841
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1842

hu's avatar
hu committed
1843
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_ACC_AIR);
hu's avatar
hu committed
1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1856 1857

void LED_ACC_AIR_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1858
{
hu's avatar
hu committed
1859
    R6_LED_OUT = led_status;
hu's avatar
hu committed
1860 1861 1862

    if (led_status == 1)
    {
hu's avatar
hu committed
1863
        SEG_LED_ACC_AIR_R(7);
hu's avatar
hu committed
1864 1865 1866
    }
    else
    {
hu's avatar
hu committed
1867
        SEG_LED_ACC_AIR_R(0);
hu's avatar
hu committed
1868 1869
    }
}
hu's avatar
hu committed
1870
/******************************************************************************
hu's avatar
hu committed
1871
  R8 ABS
hu's avatar
hu committed
1872 1873 1874 1875
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
1876
uint8_t LED_ABS_R_Judgement(void)
hu's avatar
hu committed
1877 1878
{
    uint8_t u8Result = 0u;
hu's avatar
hu committed
1879
    uint8_t m_Condition2 = 0u;
hu's avatar
hu committed
1880
    uint8_t CanStatus1 = 0u;
hu's avatar
hu committed
1881

hu's avatar
hu committed
1882 1883
    m_Condition2 = (uint8_t)Get_ID_18F0010B_Sig_EBS_Amber_Warning_State();
    CanStatus1 = CAN_MSG_Status(ID_CanMsg18F0010B_Msg_Count);
hu's avatar
hu committed
1884

hu's avatar
hu committed
1885
    if (K_Line_Set.K_Line_LID21 == 0x01)
hu's avatar
hu committed
1886
    {
hu's avatar
hu committed
1887
        if ((CanStatus1 == CAN_SIG_LOST) || (m_Condition2 == 1u))
hu's avatar
hu committed
1888 1889 1890 1891 1892 1893 1894
        {
            u8Result = 1u;
        }
        else
        {
            u8Result = 0u;
        }
hu's avatar
hu committed
1895 1896 1897 1898 1899 1900 1901 1902
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1903
void LED_ABS_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1904
{
hu's avatar
hu committed
1905
    ABS_LED_MCU_OUT = led_status;
hu's avatar
hu committed
1906

hu's avatar
hu committed
1907 1908 1909
    if (led_status == 1)
    {
        SEG_LED_ABS_R(7);
hu's avatar
hu committed
1910 1911 1912
    }
    else
    {
hu's avatar
hu committed
1913
        SEG_LED_ABS_R(0);
hu's avatar
hu committed
1914 1915 1916
    }
}

hu's avatar
hu committed
1917 1918 1919 1920 1921 1922 1923 1924 1925 1926
/******************************************************************************
U2 TRAILER ABS
  信号接口:
  信号定义:
  输出信号:U2_LED_OUT
 ******************************************************************************/
uint8_t LED_TRAILER_ABS_U_Judgement(void)
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1927

hu's avatar
hu committed
1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_TRAILER_ABS);

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}

void LED_TRAILER_ABS_U_Execution(uint8_t led_status)
{
hu's avatar
hu committed
1944
    TRAILER_ABS_LED_MCU_OUT = led_status;
hu's avatar
hu committed
1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965

    if (led_status == 1)
    {
        SEG_LED_TRAILER_ABS_U(7);
    }
    else
    {
        SEG_LED_TRAILER_ABS_U(0);
    }
}

/******************************************************************************
U3 WORKING LAMP
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_WORKING_LAMP_U_Judgement(void)
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
1966

hu's avatar
hu committed
1967 1968 1969 1970 1971 1972 1973 1974 1975 1976
    m_Condition1 = (uint8_t)XXXX;

    if (m_Condition1 == 1u)
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }
hu's avatar
hu committed
1977

hu's avatar
hu committed
1978 1979
    return u8Result;
}
hu's avatar
hu committed
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
void LED_WORKING_LAMP_U_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL11 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL11 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_WORKING_LAMP_U(7);
    }
    else
    {
        SEG_LED_WORKING_LAMP_U(0);
    }
}

hu's avatar
hu committed
2001 2002 2003 2004 2005 2006 2007 2008 2009 2010
/******************************************************************************
U6 TRAILE ABS INFO
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_TRAILER_ABS_INFO_U_Judgement(void)
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
2011

hu's avatar
hu committed
2012 2013
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_TRAILER_ABS_INFO);

hu's avatar
hu committed
2014
    if (m_Condition1 == 0x01u)
hu's avatar
hu committed
2015 2016 2017 2018 2019 2020 2021 2022 2023 2024
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043
void LED_TRAILER_ABS_INFO_U_Execution(uint8_t led_status)
{
    if (led_status == 1)
    {
        IS31_CHIP0_CHANNEL05 = LED_BRIGHTNESS;
    }
    else
    {
        IS31_CHIP0_CHANNEL05 = 0x00;
    }

    if (led_status == 1)
    {
        SEG_LED_TRAILER_ABS_INFO_U(7);
    }
    else
    {
        SEG_LED_TRAILER_ABS_INFO_U(0);
    }
hu's avatar
hu committed
2044 2045 2046 2047 2048 2049 2050 2051 2052 2053
}

/******************************************************************************
Temp
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_Temp_Judgement(void)
{
2054
    static uint8_t u8Result = 0u;
hu's avatar
hu committed
2055 2056
    uint8_t m_Condition1 = 0u;

2057 2058 2059
    m_Condition1 = Coolant_Get_CurSeg();

    if (K_Line_Set.K_Line_LID43 == 0x82u)
hu's avatar
hu committed
2060
    {
2061 2062 2063 2064 2065 2066 2067 2068
        if ((m_Condition1 >= 12u) &&  (Coolant_Get_Valid() == 1u))
        {
            u8Result = 1u;
        }
        else if (m_Condition1 <= 9u)
        {
            u8Result = 0u;
        }
hu's avatar
hu committed
2069 2070 2071 2072 2073 2074 2075 2076 2077 2078
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
void LED_Temp_Execution(uint8_t led_status)
{
2079 2080 2081 2082 2083
    COMMON_PowerStatus_t u8IG_st;

    u8IG_st = Common_Get_IG_Sts();

    if (u8IG_st == COMMON_POWER_ON)
hu's avatar
hu committed
2084
    {
2085 2086 2087 2088 2089
        if ((led_status == 1u) && (K_Line_Set.K_Line_LID43 == 0x82u))
        {
            //TimerB_PWM_Channel_Duty_Set(TIMERB_2_CH7 , testBG );//水温格白色
            TEMP_R_LED_OUT = 1u ;/*水温红灯*/
            Water_Temp_Led_R_MCU_OUT = 0u;
hu's avatar
hu committed
2090

2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101
            TEMP_W_LED_OUT = 0u ;//水温字符白色指示灯
            Water_Temp_Led_W_MCU_OUT = 1u;
        }
        else
        {
            TEMP_R_LED_OUT = 0u ;/*水温红灯*/
            Water_Temp_Led_R_MCU_OUT = 0u;

            TEMP_W_LED_OUT = 1u ;//水温字符白色指示灯
            Water_Temp_Led_W_MCU_OUT = 1u;
        }
hu's avatar
hu committed
2102 2103 2104 2105 2106 2107
    }
    else
    {
        TEMP_R_LED_OUT = 0u ;/*水温红灯*/
        Water_Temp_Led_R_MCU_OUT = 0u;

2108 2109
        TEMP_W_LED_OUT = 0u ;//水温字符白色指示灯
        Water_Temp_Led_W_MCU_OUT = 0u;
hu's avatar
hu committed
2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121
    }
}

/******************************************************************************
Fuel
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_Fuel_Judgement(void)
{
    uint8_t u8Result = 0u;
hu's avatar
hu committed
2122 2123 2124
    uint8_t variable_1 = 0x00u;
    uint8_t variable_2 = 0x00u;
    uint16_t variable_5 = 0x00u;
hu's avatar
hu committed
2125

hu's avatar
hu committed
2126 2127 2128 2129 2130
    variable_1 = Fuel_Get_CurSeg();/*格*/
    variable_2 = GetFuelSensorState();/*燃油状态*/
    variable_5 = GetFuelResistance(); /*采集的阻值*/

    if ((variable_1 <= 1 ) && (variable_2 == FuelSensorNormal) && (variable_5 != 65535) && (K_Line_Set.K_Line_LID43 == 0x82u))
hu's avatar
hu committed
2131 2132 2133 2134 2135 2136 2137 2138
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

hu's avatar
hu committed
2139

hu's avatar
hu committed
2140 2141 2142 2143
    return u8Result;
}
void LED_Fuel_Execution(uint8_t led_status)
{
2144
    COMMON_PowerStatus_t u8IG_st;
hu's avatar
hu committed
2145

2146 2147 2148
    u8IG_st = Common_Get_IG_Sts();

    if (u8IG_st == COMMON_POWER_ON)
hu's avatar
hu committed
2149
    {
hu's avatar
hu committed
2150
        if ((led_status == 1u) && (K_Line_Set.K_Line_LID43 == 0x82u))
2151
        {
hu's avatar
hu committed
2152 2153
            FUEL_LED_Y_MCU = 1u ;
            FUEL_W_LED_OUT = 0u ;
2154 2155 2156
        }
        else
        {
hu's avatar
hu committed
2157 2158
            FUEL_LED_Y_MCU = 0u ;
            FUEL_W_LED_OUT = 1u ;
2159
        }
hu's avatar
hu committed
2160 2161 2162
    }
    else
    {
hu's avatar
hu committed
2163 2164
        FUEL_LED_Y_MCU = 0u ;
        FUEL_W_LED_OUT = 0u ;
hu's avatar
hu committed
2165
    }
hu's avatar
hu committed
2166 2167 2168
}

/******************************************************************************
2169
Common_Get_L12_Air_Sta
hu's avatar
hu committed
2170 2171 2172 2173 2174 2175 2176
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t Common_Get_L12_Air_Sta(void)
{
    return L12_Air_Sta ;
hu's avatar
hu committed
2177
}