更新蜂鸣器模块
This commit is contained in:
parent
e1c3c733f0
commit
a76a286859
|
@ -11,10 +11,16 @@ inline void BUZZER_Start()
|
|||
inline void BUZZER_Stop()
|
||||
{
|
||||
HAL_GPIO_WritePin(FM_K2_POWERC_GPIO_Port, FM_K2_POWERC_Pin, GPIO_PIN_SET);
|
||||
if (state == 1)
|
||||
{
|
||||
state = 0;
|
||||
TIMER_DelLoopEvent(EVENT_BUZZER);
|
||||
}
|
||||
}
|
||||
|
||||
void BUZZER_StartTimed(uint8_t time)
|
||||
{
|
||||
state = 1;
|
||||
BUZZER_Start();
|
||||
TIMER_AddLoopEvent(EVENT_BUZZER, BUZZER_Stop, time * 100);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user