Telltales_user.c 55.5 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


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

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

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

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

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

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

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

测试用

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

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

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

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

    return u8Result;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    return u8Result;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

hu's avatar
hu committed
1466 1467
    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
1468

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

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

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

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

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

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

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

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

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

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

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

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

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

hu's avatar
hu committed
1620 1621 1622
    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
1623 1624
    CanStatus = CAN_MSG_Status(ID_CanMsg18F0010B_Msg_Count);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

hu's avatar
hu committed
1881 1882
    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
1883

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

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

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

hu's avatar
hu committed
1916 1917 1918 1919 1920 1921 1922 1923 1924 1925
/******************************************************************************
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
1926

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

    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
1965

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

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

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

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

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

    return u8Result;
}
hu's avatar
hu committed
2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042
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
2043 2044 2045 2046 2047 2048 2049 2050 2051 2052
}

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

2056 2057 2058
    m_Condition1 = Coolant_Get_CurSeg();

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

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

    u8IG_st = Common_Get_IG_Sts();

    if (u8IG_st == COMMON_POWER_ON)
hu's avatar
hu committed
2083
    {
2084 2085 2086 2087 2088
        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
2089

2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100
            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
2101 2102 2103 2104 2105 2106
    }
    else
    {
        TEMP_R_LED_OUT = 0u ;/*水温红灯*/
        Water_Temp_Led_R_MCU_OUT = 0u;

2107 2108
        TEMP_W_LED_OUT = 0u ;//水温字符白色指示灯
        Water_Temp_Led_W_MCU_OUT = 0u;
hu's avatar
hu committed
2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136
    }
}

/******************************************************************************
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)
{
2137
    COMMON_PowerStatus_t u8IG_st;
hu's avatar
hu committed
2138

2139 2140 2141
    u8IG_st = Common_Get_IG_Sts();

    if (u8IG_st == COMMON_POWER_ON)
hu's avatar
hu committed
2142
    {
2143 2144 2145 2146 2147 2148 2149 2150 2151 2152
        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
2153 2154 2155 2156
    }
    else
    {
        FUEL_LED_Y_MCU = 0U ;
2157
        FUEL_W_LED_OUT = 0U ;
hu's avatar
hu committed
2158
    }
hu's avatar
hu committed
2159 2160 2161
}

/******************************************************************************
2162
Common_Get_L12_Air_Sta
hu's avatar
hu committed
2163 2164 2165 2166 2167 2168 2169
  信号接口:
  信号定义:
  输出信号:
 ******************************************************************************/
uint8_t Common_Get_L12_Air_Sta(void)
{
    return L12_Air_Sta ;
hu's avatar
hu committed
2170
}