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