21 lines
410 B
C
21 lines
410 B
C
|
#include "buzzer.h"
|
||
|
#include "timer.h"
|
||
|
|
||
|
static uint8_t state;
|
||
|
|
||
|
inline void BUZZER_Start()
|
||
|
{
|
||
|
HAL_GPIO_WritePin(FM_K2_POWERC_GPIO_Port, FM_K2_POWERC_Pin, GPIO_PIN_RESET);
|
||
|
}
|
||
|
|
||
|
inline void BUZZER_Stop()
|
||
|
{
|
||
|
HAL_GPIO_WritePin(FM_K2_POWERC_GPIO_Port, FM_K2_POWERC_Pin, GPIO_PIN_SET);
|
||
|
}
|
||
|
|
||
|
void BUZZER_StartTimed(uint8_t time)
|
||
|
{
|
||
|
BUZZER_Start();
|
||
|
TIMER_AddLoopEvent(EVENT_BUZZER, BUZZER_Stop, time * 100);
|
||
|
}
|