mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 11:37:45 +08:00
添加ozone调试教程和vscode使用
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
#include "bsp_buzzer.h"
|
||||
#include "main.h"
|
||||
extern TIM_HandleTypeDef htim4;
|
||||
void buzzer_on(uint16_t psc, uint16_t pwm)
|
||||
{
|
||||
__HAL_TIM_PRESCALER(&htim4, psc);
|
||||
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_3, pwm);
|
||||
|
||||
extern TIM_HandleTypeDef htim4;
|
||||
static uint8_t tmp_warning_level=0;
|
||||
|
||||
void buzzer_on(uint16_t psc, uint16_t pwm,uint8_t level)
|
||||
{
|
||||
if(level>tmp_warning_level)
|
||||
{
|
||||
tmp_warning_level=level;
|
||||
__HAL_TIM_PRESCALER(&htim4, psc);
|
||||
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_3, pwm);
|
||||
}
|
||||
}
|
||||
void buzzer_off(void)
|
||||
{
|
||||
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_3, 0);
|
||||
tmp_warning_level=0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user