#ifndef _BSP_TRIP_KEY_
#define _BSP_TRIP_KEY_
#define PRESS_STEP 160
#define DOWN1_S 330
#define DOWN1_E DOWN1_S + PRESS_STEP
#define UP1_S  DOWN1_E
#define UP1_E  UP1_S +PRESS_STEP

#define DOWN2_S UP1_E
#define DOWN2_E DOWN2_S + PRESS_STEP
#define UP2_S  DOWN2_E
#define UP2_E  UP2_S +PRESS_STEP

#define DOWN3_S UP2_E
#define DOWN3_E DOWN3_S + PRESS_STEP
#define UP3_S  DOWN3_E
#define UP3_E  UP3_S +PRESS_STEP

#define DOWN4_S UP3_E
#define DOWN4_E DOWN4_S + PRESS_STEP
#define UP4_S  DOWN4_E
#define UP4_E  UP4_S +PRESS_STEP

#define DOWN5_S UP4_E
#define DOWN5_E DOWN5_S + PRESS_STEP
#define UP5_S  DOWN5_E
#define UP5_E  UP5_S +PRESS_STEP

#define DOWN6_S UP5_E
#define DOWN6_E DOWN6_S + PRESS_STEP
#define UP6_S  DOWN6_E
#define UP6_E  UP6_S +PRESS_STEP

#define DOWN7_S UP6_E
#define DOWN7_E DOWN7_S + PRESS_STEP
#define UP7_S  DOWN7_E
#define UP7_E  UP7_S +PRESS_STEP

#define DOWN8_S UP7_E
#define DOWN8_E DOWN8_S + PRESS_STEP
#define UP8_S  DOWN8_E
#define UP8_E  UP8_S +PRESS_STEP

#define STOP_PRESS_TIME UP8_E +100

#define OFF_ALL_LED 0

#define LIGHT_LED1 1
#define LIGHT_LED2 2
#define LIGHT_LED3 3
#define LIGHT_LED4 4
#define LIGHT_LED5 5
#define LIGHT_LED6 6
#define LIGHT_LED7 7

//extern void LightLedLamp(uint8_t lightLampIndex);
//extern void LightLedLampOnly(uint8_t lightLampIndex);

#define PressTripKeyIGN1On()\
if (TripKeyCurrent.Time >= 10 && TripKeyCurrent.Time < 310) {\
    LampState_L.Lamps.RELAY_B = 1;\
    LampState_L.Lamps.RELAY_IGN1 = 0;\
} \
else if (TripKeyCurrent.Time >= 310 && TripKeyCurrent.Time < 320) {\
    LampState_L.Lamps.RELAY_B = 1;\
    LampState_L.Lamps.RELAY_IGN1 = 1;\
} 

#define PressTripKeyBOn()\
if (TripKeyCurrent.Time >= 10 && TripKeyCurrent.Time < 110) {\
    LampState_L.Lamps.RELAY_B = 0;\
    LampState_L.Lamps.RELAY_IGN1 = 0;\
} \
else if (TripKeyCurrent.Time >= 110 && TripKeyCurrent.Time < 120) {\
    LampState_L.Lamps.RELAY_B = 1;\
    LampState_L.Lamps.RELAY_IGN1 = 1;\
    CheckClusterValid = 0;\
} 


#define InitPressTripKey() {\
    TripKeyCurrent.Time = 0;\
    TripKeyCurrent.enable = 1;\
}

#define PressTripKeyStop()\
 if (TripKeyCurrent.Time >= STOP_PRESS_TIME) {\
    TripKeyCurrent.Time = STOP_PRESS_TIME;\
    TripKeyCurrent.enable = 0;\
}

extern void TripKeyMenu(uint8_t uiKeyPressOrder);
extern void TripKeyDown(uint8_t uiKeyPressOrder);
extern void TripKeyUp(uint8_t uiKeyPressOrder);
extern void TripKeyOk(uint8_t uiKeyPressOrder);

#endif // #define _BSP_TRIP_KEY_