Commit bd0ff563 authored by 李冠华's avatar 李冠华

feat:混动车型增加蜂鸣器相关功能逻辑

parent 2dad489e
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
uint8_t BUZZER_ON = 0; uint8_t BUZZER_ON = 0;
uint16_t Buzzer_time = 0; uint16_t Buzzer_time = 0;
uint8_t BuzzerReadyCount = 0U;
void Buzzer_KL30_Init(void) void Buzzer_KL30_Init(void)
{ {
BUZZER_ON = 0;
Buzzer_time = 0;
BuzzerReadyCount = 0U;
} }
...@@ -16,14 +20,16 @@ void Buzzer_KL15_Init(void) ...@@ -16,14 +20,16 @@ void Buzzer_KL15_Init(void)
void BUZZER_Init(void) void BUZZER_Init(void)
{ {
#if (PART_NUMBER == RMR42E_60)
Buzzer_time = 0; Buzzer_time = 0;
BUZZER_ON = 0; BUZZER_ON = 0;
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW); // OUT_EN_1 RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW); // OUT_EN_1
#endif
} }
void Buzzer_Service(void) void Buzzer_Service(void)
{ {
#if (PART_NUMBER == RMR42E_60)
if ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL)) if ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
{ {
if (g_u8TYWClearEepromFlag >= 1) if (g_u8TYWClearEepromFlag >= 1)
...@@ -69,7 +75,34 @@ void Buzzer_Service(void) ...@@ -69,7 +75,34 @@ void Buzzer_Service(void)
{ {
BUZZER_Init(); BUZZER_Init();
} }
#else
if (Get_TelltalesLedSts(em_LED_Grass_Full_R) == 1U)
{
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_HIGH);
BUZZER_ON = 1U;
}
else if (Get_TelltalesLedSts(em_LED_READY_G) == 1U)
{
if (BuzzerReadyCount < 20U)
{
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_HIGH);
BUZZER_ON = 1U;
BuzzerReadyCount ++;
}
else
{
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW);
BUZZER_ON = 0U;
}
}
else
{
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW);
BUZZER_ON = 0U;
BuzzerReadyCount = 0U;
}
#endif
} }
...@@ -83,7 +116,7 @@ void Buzzer_Service(void) ...@@ -83,7 +116,7 @@ void Buzzer_Service(void)
******************************************************************************/ ******************************************************************************/
uint8_t Get_Buzzer_Status(void) uint8_t Get_Buzzer_Status(void)
{ {
return 0; return BUZZER_ON;
} }
...@@ -13,5 +13,6 @@ extern void Buzzer_KL15_Init(void); ...@@ -13,5 +13,6 @@ extern void Buzzer_KL15_Init(void);
extern void Buzzer_Service(void); extern void Buzzer_Service(void);
extern void BUZZER_Init(void); extern void BUZZER_Init(void);
extern uint8_t Get_Buzzer_Status(void);
#endif #endif
...@@ -52,7 +52,7 @@ void Can_Set_Buff_3A2(canlib_uint8_t CopyData[]) ...@@ -52,7 +52,7 @@ void Can_Set_Buff_3A2(canlib_uint8_t CopyData[])
p3A2->Sig.ICU_LEDLightState = Get_TelltalesLedSts(em_LED_LED_Open_W); p3A2->Sig.ICU_LEDLightState = Get_TelltalesLedSts(em_LED_LED_Open_W);
p3A2->Sig.ICU_BuzzerState = 0; p3A2->Sig.ICU_BuzzerState = Get_Buzzer_Status();
p3A2->Sig.ICU_GrassFullState = Get_TelltalesLedSts(em_LED_Grass_Full_R); p3A2->Sig.ICU_GrassFullState = Get_TelltalesLedSts(em_LED_Grass_Full_R);
......
...@@ -77,6 +77,7 @@ static void Power_KL30_Init(void) ...@@ -77,6 +77,7 @@ static void Power_KL30_Init(void)
Data_Gear_KL30_Init(); Data_Gear_KL30_Init();
Data_Fuel_KL30_Init(); Data_Fuel_KL30_Init();
Fault_Code_KL30_Init(); Fault_Code_KL30_Init();
Buzzer_KL30_Init();
} }
extern uint32_t PowerIgnOffTimeLine; extern uint32_t PowerIgnOffTimeLine;
......
...@@ -52,6 +52,7 @@ void Sys_50ms_Tasks(void) ...@@ -52,6 +52,7 @@ void Sys_50ms_Tasks(void)
Gauge_Service(); Gauge_Service();
Data_Soc_Service(); Data_Soc_Service();
Fault_Code_Display_Queue(50U); Fault_Code_Display_Queue(50U);
Buzzer_Service();
} }
void Sys_15ms_Tasks(void) void Sys_15ms_Tasks(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment