|
@@ -39,8 +39,8 @@ static void bikelight_voSetBikeLightOn(void)
|
|
|
{
|
|
|
if (bikelight_stBikeLightOut.LightState == LIGHT_Off)
|
|
|
{
|
|
|
- IO_BIKELIGHT_ON;
|
|
|
-
|
|
|
+ IO_BIKELIGHT_FRONT_ON;
|
|
|
+ IO_BIKELIGHT_REAR_ON;
|
|
|
bikelight_stBikeLightOut.LightState = LIGHT_On;
|
|
|
}
|
|
|
}
|
|
@@ -58,7 +58,8 @@ static void bikelight_voSetBikeLightOff(void)
|
|
|
{
|
|
|
if (bikelight_stBikeLightOut.LightState == LIGHT_On)
|
|
|
{
|
|
|
- IO_BIKELIGHT_OFF;
|
|
|
+ IO_BIKELIGHT_FRONT_OFF;
|
|
|
+ IO_BIKELIGHT_REAR_OFF;
|
|
|
bikelight_stBikeLightOut.LightState = LIGHT_Off;
|
|
|
}
|
|
|
}
|
|
@@ -80,8 +81,8 @@ void bikelight_voGetBikeLightError(UWORD LightPowerVolPu)
|
|
|
bikelight_stBikeLightOut.uwBikeLightErrorCnt++;
|
|
|
if (bikelight_stBikeLightOut.uwBikeLightErrorCnt == bikelight_stBikeLightCoef.uwBikeLightErrorCnt)
|
|
|
{
|
|
|
- IO_BIKELIGHT_OFF;
|
|
|
-
|
|
|
+ IO_BIKELIGHT_FRONT_OFF;
|
|
|
+ IO_BIKELIGHT_REAR_OFF;
|
|
|
bikelight_stBikeLightOut.uwBikeLightErrorCnt = 0;
|
|
|
bikelight_stBikeLightOut.LightState = LIGHT_Error;
|
|
|
bikelight_stBikeLightOut.blBikeLightErrorFlg = TRUE;
|
|
@@ -94,15 +95,16 @@ void bikelight_voGetBikeLightError(UWORD LightPowerVolPu)
|
|
|
|
|
|
if (bikelight_stBikeLightOut.LightState == LIGHT_Error)
|
|
|
{
|
|
|
- IO_BIKELIGHT_ON;
|
|
|
-
|
|
|
+ IO_BIKELIGHT_FRONT_ON;
|
|
|
+ IO_BIKELIGHT_REAR_ON;
|
|
|
if (LightPowerVolPu > bikelight_stBikeLightCoef.uwBikeLightErrorVoltagePuDown &&
|
|
|
LightPowerVolPu < bikelight_stBikeLightCoef.uwBikeLightErrorVoltagePuUp)
|
|
|
{
|
|
|
bikelight_stBikeLightOut.uwBikeLightRecoverCnt++;
|
|
|
if (bikelight_stBikeLightOut.uwBikeLightRecoverCnt == bikelight_stBikeLightCoef.uwBikeLightRecoverCnt)
|
|
|
{
|
|
|
- IO_BIKELIGHT_OFF;
|
|
|
+ IO_BIKELIGHT_FRONT_OFF;
|
|
|
+ IO_BIKELIGHT_REAR_OFF;
|
|
|
bikelight_stBikeLightOut.uwBikeLightRecoverCnt = 0;
|
|
|
bikelight_stBikeLightOut.LightState = LIGHT_Off;
|
|
|
bikelight_stBikeLightOut.blBikeLightErrorFlg = FALSE;
|
|
@@ -110,8 +112,8 @@ void bikelight_voGetBikeLightError(UWORD LightPowerVolPu)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- IO_BIKELIGHT_OFF;
|
|
|
-
|
|
|
+ IO_BIKELIGHT_FRONT_OFF;
|
|
|
+ IO_BIKELIGHT_REAR_OFF;
|
|
|
bikelight_stBikeLightOut.uwBikeLightShutCnt++;
|
|
|
bikelight_stBikeLightOut.uwBikeLightRecoverCnt = 0;
|
|
|
if (bikelight_stBikeLightOut.uwBikeLightShutCnt == bikelight_stBikeLightCoef.uwBikeLightShutCnt)
|
|
@@ -167,15 +169,16 @@ void bikelight_voBikeLightCoef(UWORD volt)
|
|
|
bikelight_stBikeLightCoef.uwBikeLightErrorVoltagePuDown = ((ULONG)LIGHT_POWER_ERROR_VOLTAGE_DOWN << 15) / VBASE;
|
|
|
bikelight_stBikeLightCoef.uwBikeLightErrorVoltagePuUp = ((ULONG)LIGHT_POWER_ERROR_VOLTAGE_UP << 15) / VBASE;
|
|
|
|
|
|
- IO_BIKELIGHT_12V_ENABLE;
|
|
|
-
|
|
|
+ IO_BIKELIGHT_FRONT_12V_ENABLE;
|
|
|
+ IO_BIKELIGHT_REAR_12V_ENABLE;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
bikelight_stBikeLightCoef.uwBikeLightErrorVoltagePuDown = ((ULONG)LIGHT_POWER_ERROR_VOLTAGE_DOWN << 14) / VBASE;
|
|
|
bikelight_stBikeLightCoef.uwBikeLightErrorVoltagePuUp = ((ULONG)LIGHT_POWER_ERROR_VOLTAGE_UP << 14) / VBASE;
|
|
|
|
|
|
- IO_BIKELIGHT_12V_DISABLE;
|
|
|
+ IO_BIKELIGHT_FRONT_12V_DISABLE;
|
|
|
+ IO_BIKELIGHT_REAR_12V_DISABLE;
|
|
|
}
|
|
|
}
|
|
|
/***************************************************************
|