Telltales_user.c 54.2 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//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
15
#include "Data_AirPressure.h"
hu's avatar
hu committed
16 17


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

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
33
    {   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
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
    {   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               },
    {   em_LED_TPMS_L                     , NoSelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_TPMS_L_Judgement                     , LED_TPMS_L_Execution                       },
    {   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
54
    {   em_LED_ABS_R                      ,   SelfCheck ,   NoExterNalCheck ,  LED_IGN_ON     ,       0u,         3000ul,     LED_ABS_R_Judgement                      , LED_ABS_R_Execution                        },
hu's avatar
hu committed
55 56 57 58 59 60 61
    {   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
62 63
    {   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
64 65 66 67 68 69 70 71 72 73 74
};

/*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
75 76

    L12_Air_Sta = 0u;
hu's avatar
hu committed
77
}
hu's avatar
hu committed
78

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

hu's avatar
hu committed
83 84 85 86
/******************************************************************************
  T0 左转向   T13 右转向
  信号接口:
  信号定义:
hu's avatar
hu committed
87
  输出信号:
hu's avatar
hu committed
88
 ******************************************************************************/
hu's avatar
hu committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102
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);//左转向断码屏开
103
        IS31_CHIP0_CHANNEL36 = 0x3Fu;
hu's avatar
hu committed
104 105 106 107 108 109
    }
    else
    {
        SEG_LED_TURN_LEFT(0);
        IS31_CHIP0_CHANNEL36 = 0x00u;
    }
110
    if (TelltaleLRCtrl.LastLeft != LEFT_ST)
hu's avatar
hu committed
111 112 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
    {
        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);
        }
    }
}

160
#if 0
hu's avatar
hu committed
161 162 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
/*************************************

测试用

**************************************/
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
209
/*---------------------------------------------------------------------------*/
hu's avatar
hu committed
210 211 212
#define XXXX  0u
#define LED_BRIGHTNESS 0xff

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

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

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

    return u8Result;
}

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

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

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

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

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

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

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

hu's avatar
hu committed
307
    m_Condition1 = (uint8_t)Get_ID_18FF2300_Sig_Exh_Lamp();
308

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

hu's avatar
hu committed
318 319 320 321 322 323 324 325 326 327 328 329
    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;
    }
330

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

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

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

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

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

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

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

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

    return u8Result;
}
hu's avatar
hu committed
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428
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
429

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

hu's avatar
hu committed
441
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_Rr_FOG_LAMP);
hu's avatar
hu committed
442

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

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

hu's avatar
hu committed
458 459 460 461 462 463 464 465 466 467 468 469
    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
470
  信号接口: A31 HIGH
hu's avatar
hu committed
471 472 473 474
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_MIL_T_Judgement(void)
hu's avatar
hu committed
475 476 477
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
478

hu's avatar
hu committed
479
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_MIL);
hu's avatar
hu committed
480 481 482

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

    return u8Result;
}
hu's avatar
hu committed
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511
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
512

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

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

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

    return u8Result;
}
hu's avatar
hu committed
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556
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
557

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

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

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

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

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

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

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

    return u8Result;
}
hu's avatar
hu committed
647 648
void LED_RETARDER_T_Execution(uint8_t led_status)
{
hu's avatar
hu committed
649
    if (K_Line_Set.K_Line_LID41 == 0x13u)
hu's avatar
hu committed
650
    {
hu's avatar
hu committed
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
        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
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
    }
    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
692 693 694
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
695

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

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

    return u8Result;
}

hu's avatar
hu committed
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731
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
732
  L1 ROWS
hu's avatar
hu committed
733 734 735 736
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
hu's avatar
hu committed
737
uint8_t LED_ROWS_L_Judgement(void)
hu's avatar
hu committed
738 739 740
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
hu's avatar
hu committed
741

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

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

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

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

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

hu's avatar
hu committed
787
    m_Condition1 = (uint8_t)XXXX;
hu's avatar
hu committed
788 789 790 791

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

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

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

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

hu's avatar
hu committed
834 835 836 837
    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
838
    if (K_Line_Set.K_Line_LID28 == 0x01u)
hu's avatar
hu committed
839
    {
hu's avatar
hu committed
840
        if ((m_Condition1 == 0x02u) || (m_Condition2 == 0x02u) || (m_Condition3 == 0x02u))
hu's avatar
hu committed
841 842 843
        {
            u8Result = 1u;
        }
hu's avatar
hu committed
844
        else if ((m_Condition1 == 0x0Eu) || (m_Condition2 == 0x0Eu) || (m_Condition3 == 0x0Eu))
hu's avatar
hu committed
845 846 847
        {
            u8Result = FLASH_SYNC_1Hz;
        }
hu's avatar
hu committed
848
    }
hu's avatar
hu committed
849 850 851 852 853 854 855
    else
    {
        u8Result = 0u;
    }

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

hu's avatar
hu committed
869 870 871 872 873 874 875 876 877

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

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

hu's avatar
hu committed
900 901
    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
902

hu's avatar
hu committed
903 904 905 906
    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
907
    {
hu's avatar
hu committed
908 909 910 911 912 913 914 915 916 917 918 919 920
        /*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
921 922 923 924 925 926 927 928
    }
    else
    {
        u8Result = 0u;
    }

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

hu's avatar
hu committed
932
    if (K_Line_Set.K_Line_LID28 == 0x01u)
hu's avatar
hu committed
933
    {
hu's avatar
hu committed
934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950
        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
951 952 953
    }
    else
    {
hu's avatar
hu committed
954
        IS31_CHIP0_CHANNEL04 = 0x00u;
hu's avatar
hu committed
955
        SEG_LED_LDWS_L(0);
hu's avatar
hu committed
956 957 958
    }
}

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

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

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

    return u8Result;
}
hu's avatar
hu committed
983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002
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
1003

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

hu's avatar
hu committed
1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027
    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
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037
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
1038

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

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

hu's avatar
hu committed
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072
    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
1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092
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
1093

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

hu's avatar
hu committed
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117
    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
1118 1119 1120 1121 1122 1123 1124 1125 1126 1127
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
1128

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

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

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

    return u8Result;
}
hu's avatar
hu committed
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181
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
1182

hu's avatar
hu committed
1183
/******************************************************************************
hu's avatar
hu committed
1184
  L10 TPMS
hu's avatar
hu committed
1185 1186 1187 1188 1189
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_TPMS_L_Judgement(void)
hu's avatar
hu committed
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203
{
    uint8_t u8Result = 0u;
    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;

    m_Condition1 = (uint8_t)Get_ID_18011733_Sig_Low_Presure_Alarm();
    m_Condition2 = (uint8_t)Get_ID_18011733_Sig_High_Presure_Alarm();
    m_Condition3 = (uint8_t)Get_ID_18011733_Sig_High_Temperature_Alarm();
    m_Condition4 = (uint8_t)Get_ID_18011733_Sig_No_signal_Alarm();
    m_Condition5 = (uint8_t)Get_ID_18011733_Sig_Sensor_fault_information();

hu's avatar
hu committed
1204
    if (K_Line_Set.K_Line_LID3E == 0x01u)
hu's avatar
hu committed
1205
    {
hu's avatar
hu committed
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217
        if ((m_Condition1 == 1u) || (m_Condition2 == 1u) || (m_Condition3 == 1u))
        {
            u8Result = 1u;
        }
        else if ((m_Condition4 == 1u) || (m_Condition5 == 7u) || (m_Condition5 == 8u) || (m_Condition5 == 9u))
        {
            u8Result = FLASH_SYNC_1Hz;
        }
        else
        {
            u8Result = 0u;
        }
hu's avatar
hu committed
1218 1219 1220 1221 1222 1223 1224 1225
    }
    else
    {
        u8Result = 0u;
    }

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

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

hu's avatar
hu committed
1266 1267
    m_Condition1 = (uint8_t)Get_ID_18F0010B_Sig_ASR_Offroad_Switch();

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

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

hu's avatar
hu committed
1299 1300 1301 1302 1303 1304 1305 1306
        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
1307 1308 1309
    }
    else
    {
hu's avatar
hu committed
1310
        IS31_CHIP0_CHANNEL18 = 0x0u;
hu's avatar
hu committed
1311 1312 1313
        SEG_LED_ASR_or_EVSC_OFF_L(0);
    }
}
hu's avatar
hu committed
1314

hu's avatar
hu committed
1315
/******************************************************************************
hu's avatar
hu committed
1316
  L12 EVSC
hu's avatar
hu committed
1317 1318 1319
  信号接口:
  信号定义:
  输出信号:
hu's avatar
hu committed
1320
  调整依据:SXS-VC66-22_EBS WARNING & INDICATOR (7“LCD)改訂1-1_20211116
hu's avatar
hu committed
1321 1322
 ******************************************************************************/
uint8_t LED_EVSC_L_Judgement(void)
hu's avatar
hu committed
1323 1324
{
    uint8_t u8Result = 0u;
hu's avatar
hu committed
1325 1326
    uint8_t CanStatus1 = 0u;
    uint8_t CanStatus2 = 0u;
hu's avatar
hu committed
1327 1328 1329 1330 1331
    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
1332 1333
    uint16_t m_Condition6 = 0u;
    uint16_t m_Condition7 = 0u;
hu's avatar
hu committed
1334

hu's avatar
hu committed
1335 1336 1337
    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
1338
    m_Condition2 = (uint8_t)Get_ID_18F0010B_Sig_EBS_Red_Warning_Lamp_State(); /*byte6 34*/
hu's avatar
hu committed
1339 1340 1341
    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
1342 1343 1344 1345 1346
    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
1347
    {
hu's avatar
hu committed
1348
        L12_Air_Sta  = 1u;
hu's avatar
hu committed
1349
    }
hu's avatar
hu committed
1350
    else if ((m_Condition6 >= 1990u) && (m_Condition7 >= 1990u))
hu's avatar
hu committed
1351
    {
hu's avatar
hu committed
1352
        L12_Air_Sta = 0u;
hu's avatar
hu committed
1353
    }
hu's avatar
hu committed
1354 1355 1356 1357 1358

    if (
        (m_Condition1 == 1u) || (L12_Air_Sta == 1u) ||
        (((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
1359
    )
hu's avatar
hu committed
1360
    {
hu's avatar
hu committed
1361
        u8Result = 1u;
hu's avatar
hu committed
1362
    }
hu's avatar
hu committed
1363 1364
    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
1365
    {
hu's avatar
hu committed
1366
        u8Result = FLASH_SYNC_2Hz;
hu's avatar
hu committed
1367
    }
hu's avatar
hu committed
1368 1369 1370 1371 1372 1373 1374
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1375
void LED_EVSC_L_Execution(uint8_t led_status)
hu's avatar
hu committed
1376
{
hu's avatar
hu committed
1377
    if (led_status == 1)
hu's avatar
hu committed
1378
    {
hu's avatar
hu committed
1379
        IS31_CHIP0_CHANNEL19 = LED_BRIGHTNESS;
hu's avatar
hu committed
1380 1381 1382
    }
    else
    {
hu's avatar
hu committed
1383
        IS31_CHIP0_CHANNEL19 = 0x00;
hu's avatar
hu committed
1384 1385
    }

hu's avatar
hu committed
1386
    if (led_status == 1)
hu's avatar
hu committed
1387
    {
hu's avatar
hu committed
1388
        SEG_LED_EVSC_L(7);
hu's avatar
hu committed
1389 1390 1391
    }
    else
    {
hu's avatar
hu committed
1392
        SEG_LED_EVSC_L(0);
hu's avatar
hu committed
1393 1394 1395
    }
}

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

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

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

hu's avatar
hu committed
1437
    if ((led_status == 1) || (led_status == 2))
hu's avatar
hu committed
1438
    {
hu's avatar
hu committed
1439
        SEG_LED_eco_stop_OFF_L(7);
hu's avatar
hu committed
1440 1441 1442
    }
    else
    {
hu's avatar
hu committed
1443
        SEG_LED_eco_stop_OFF_L(0);
hu's avatar
hu committed
1444 1445 1446
    }
}

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

hu's avatar
hu committed
1463 1464
    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
1465

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

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

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

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

hu's avatar
hu committed
1525
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_WEAR_IND);
hu's avatar
hu committed
1526
    m_Condition2 = (uint8_t)Line_In_Get_Status(LINE_IN_WEAR2);
hu's avatar
hu committed
1527

hu's avatar
hu committed
1528
    if ((m_Condition1 == 1u) || (m_Condition2 == 0x01u))
hu's avatar
hu committed
1529 1530 1531 1532 1533 1534 1535 1536 1537 1538
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

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

    if (led_status == 1)
    {
hu's avatar
hu committed
1552
        SEG_LED_WEAR_IND_L(7);
hu's avatar
hu committed
1553 1554 1555
    }
    else
    {
hu's avatar
hu committed
1556
        SEG_LED_WEAR_IND_L(0);
hu's avatar
hu committed
1557 1558 1559
    }
}

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

hu's avatar
hu committed
1572
    if (m_Condition1 == 1u)
hu's avatar
hu committed
1573
    {
hu's avatar
hu committed
1574
        u8Result = 1u;
hu's avatar
hu committed
1575 1576 1577
    }
    else
    {
hu's avatar
hu committed
1578
        u8Result = 0u;
hu's avatar
hu committed
1579 1580
    }

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

    if (led_status == 1)
    {
hu's avatar
hu committed
1596
        SEG_LED_PARK_BRAKE_R(7);
hu's avatar
hu committed
1597 1598 1599
    }
    else
    {
hu's avatar
hu committed
1600
        SEG_LED_PARK_BRAKE_R(0);
hu's avatar
hu committed
1601 1602 1603
    }
}

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

hu's avatar
hu committed
1617 1618 1619
    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
1620 1621
    CanStatus = CAN_MSG_Status(ID_CanMsg18F0010B_Msg_Count);

hu's avatar
hu committed
1622 1623
    if ((m_Condition1 == 0x01u) || (L12_Air_Sta == 0x01u) ||
            ((K_Line_Set.K_Line_LID21 == 0x01u) && ((m_Condition3 == 1u) || (CanStatus == CAN_SIG_LOST))))
hu's avatar
hu committed
1624
    {
hu's avatar
hu committed
1625
        u8Result = 1u;
hu's avatar
hu committed
1626 1627 1628 1629 1630 1631 1632 1633
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
1634
void LED_BRAKE_AIR_or_EBS_RED_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1635
{
hu's avatar
hu committed
1636
    BRAKE_AIR_EBS_LED_MCU = led_status;
hu's avatar
hu committed
1637 1638 1639

    if (led_status == 1)
    {
hu's avatar
hu committed
1640
        SEG_LED_BRAKE_AIR_or_EBS_RED_R(7);
hu's avatar
hu committed
1641 1642 1643
    }
    else
    {
hu's avatar
hu committed
1644
        SEG_LED_BRAKE_AIR_or_EBS_RED_R(0);
hu's avatar
hu committed
1645 1646 1647
    }
}

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

hu's avatar
hu committed
1659
    m_Condition1 = (uint8_t)XXXX;
hu's avatar
hu committed
1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671

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

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

    if (led_status == 1)
    {
hu's avatar
hu committed
1685
        SEG_LED_BRAKE_LOCK_R(7);
hu's avatar
hu committed
1686 1687 1688
    }
    else
    {
hu's avatar
hu committed
1689
        SEG_LED_BRAKE_LOCK_R(0);
hu's avatar
hu committed
1690 1691
    }
}
hu's avatar
hu committed
1692

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

hu's avatar
hu committed
1704
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_AIR_SUS);
hu's avatar
hu committed
1705

hu's avatar
hu committed
1706
    if (m_Condition1 == 1u)
hu's avatar
hu committed
1707 1708 1709 1710 1711 1712 1713
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }
hu's avatar
hu committed
1714

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

    if (led_status == 1)
    {
hu's avatar
hu committed
1730
        SEG_LED_AIR_SUS_R(7);
hu's avatar
hu committed
1731 1732 1733
    }
    else
    {
hu's avatar
hu committed
1734
        SEG_LED_AIR_SUS_R(0);
hu's avatar
hu committed
1735 1736 1737
    }
}

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

hu's avatar
hu committed
1749
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_TRAILER_BRAKE);
hu's avatar
hu committed
1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761

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

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

    if (led_status == 1)
    {
hu's avatar
hu committed
1775
        SEG_LED_TRAILER_BRAKE_R(7);
hu's avatar
hu committed
1776 1777 1778
    }
    else
    {
hu's avatar
hu committed
1779
        SEG_LED_TRAILER_BRAKE_R(0);
hu's avatar
hu committed
1780 1781 1782
    }
}

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

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

hu's avatar
hu committed
1796
    if (m_Condition1 == 1u)
hu's avatar
hu committed
1797
    {
hu's avatar
hu committed
1798
        u8Result = 0u;
hu's avatar
hu committed
1799 1800 1801 1802 1803 1804 1805 1806
    }
    else
    {
        u8Result = 0u;
    }

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

    if (led_status == 1)
    {
hu's avatar
hu committed
1820
        SEG_LED_BRAKE_AIR_or_EBS_YELLOW_R(7);
hu's avatar
hu committed
1821 1822 1823
    }
    else
    {
hu's avatar
hu committed
1824
        SEG_LED_BRAKE_AIR_or_EBS_YELLOW_R(0);
hu's avatar
hu committed
1825 1826 1827
    }
}

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

hu's avatar
hu committed
1839
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_ACC_AIR);
hu's avatar
hu committed
1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851

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

    return u8Result;
}
hu's avatar
hu committed
1852 1853

void LED_ACC_AIR_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1854
{
hu's avatar
hu committed
1855
    R6_LED_OUT = led_status;
hu's avatar
hu committed
1856 1857 1858

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

hu's avatar
hu committed
1878 1879
    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
1880

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

    return u8Result;
}
hu's avatar
hu committed
1899
void LED_ABS_R_Execution(uint8_t led_status)
hu's avatar
hu committed
1900
{
hu's avatar
hu committed
1901
    ABS_LED_MCU_OUT = led_status;
hu's avatar
hu committed
1902

hu's avatar
hu committed
1903 1904 1905
    if (led_status == 1)
    {
        SEG_LED_ABS_R(7);
hu's avatar
hu committed
1906 1907 1908
    }
    else
    {
hu's avatar
hu committed
1909
        SEG_LED_ABS_R(0);
hu's avatar
hu committed
1910 1911 1912
    }
}

hu's avatar
hu committed
1913 1914 1915 1916 1917 1918 1919 1920 1921 1922
/******************************************************************************
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
1923

hu's avatar
hu committed
1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939
    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
1940
    TRAILER_ABS_LED_MCU_OUT = led_status;
hu's avatar
hu committed
1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961

    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
1962

hu's avatar
hu committed
1963 1964 1965 1966 1967 1968 1969 1970 1971 1972
    m_Condition1 = (uint8_t)XXXX;

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

hu's avatar
hu committed
1974 1975
    return u8Result;
}
hu's avatar
hu committed
1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996
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
1997 1998 1999 2000 2001 2002 2003 2004 2005 2006
/******************************************************************************
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
2007

hu's avatar
hu committed
2008 2009
    m_Condition1 = (uint8_t)Line_In_Get_Status(LINE_IN_TRAILER_ABS_INFO);

hu's avatar
hu committed
2010
    if (m_Condition1 == 0x01u)
hu's avatar
hu committed
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
    {
        u8Result = 1u;
    }
    else
    {
        u8Result = 0u;
    }

    return u8Result;
}
hu's avatar
hu committed
2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039
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
2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120
}

/******************************************************************************
Temp
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_Temp_Judgement(void)
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;

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

    return u8Result;
}
void LED_Temp_Execution(uint8_t led_status)
{
    if (led_status == 1u)
    {
        //TimerB_PWM_Channel_Duty_Set(TIMERB_2_CH7 , testBG );//水温格白色
        TEMP_R_LED_OUT = 1u ;/*水温红灯*/
        Water_Temp_Led_R_MCU_OUT = 1u;

        TEMP_W_LED_OUT = 0u ;//水温字符白色指示灯
        Water_Temp_Led_W_MCU_OUT = 0u;
    }
    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;
    }
}

/******************************************************************************
Fuel
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t LED_Fuel_Judgement(void)
{
    uint8_t u8Result = 0u;
    uint8_t m_Condition1 = 0u;
    //m_Condition1 = Fuel_Get_LowAlarm();

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

    return u8Result;
}
void LED_Fuel_Execution(uint8_t led_status)
{
    if (led_status == 1u)

    {
        FUEL_LED_Y_MCU = 1U ;
        FUEL_W_LED_OUT = 0U ;
    }
    else
    {
        FUEL_LED_Y_MCU = 0U ;
        FUEL_W_LED_OUT = 1U ;
    }
hu's avatar
hu committed
2121
}