Add default frequency to loudspeaker set
This commit is contained in:
parent
2c3c1c9861
commit
0e114d1344
@ -146,7 +146,7 @@ void loudspeaker_setup(void)
|
|||||||
static void loudspeaker_start_beep(uint16_t val)
|
static void loudspeaker_start_beep(uint16_t val)
|
||||||
{
|
{
|
||||||
#if LOUDSPEAKER_MULTIFREQ
|
#if LOUDSPEAKER_MULTIFREQ
|
||||||
TIM7->ARR = val;
|
TIM7->ARR = (val == 1 ? LOUDSPEAKER_MULTIFREQ_DEFAULT : val);
|
||||||
TIM7->CNT = 0UL;
|
TIM7->CNT = 0UL;
|
||||||
TIM7->CR1 |= TIM_CR1_CEN;
|
TIM7->CR1 |= TIM_CR1_CEN;
|
||||||
#else
|
#else
|
||||||
|
@ -59,6 +59,7 @@ int led_get(uint8_t num);
|
|||||||
#define LOUDSPEAKER_RCC_MASK RCC_AHB1ENR_GPIOBEN
|
#define LOUDSPEAKER_RCC_MASK RCC_AHB1ENR_GPIOBEN
|
||||||
#define LOUDSPEAKER_PIN 1
|
#define LOUDSPEAKER_PIN 1
|
||||||
#define LOUDSPEAKER_MULTIFREQ 1
|
#define LOUDSPEAKER_MULTIFREQ 1
|
||||||
|
#define LOUDSPEAKER_MULTIFREQ_DEFAULT 9
|
||||||
|
|
||||||
void loudspeaker_setup(void);
|
void loudspeaker_setup(void);
|
||||||
void loudspeaker_set(uint16_t val);
|
void loudspeaker_set(uint16_t val);
|
||||||
|
Loading…
Reference in New Issue
Block a user