/** * TODO file description */ #include "main.h" #include "app_buzzer.h" #include "tim.h" #include "FreeRTOS.h" #include "task.h" void app_buzzer_init() { /* Enable buzzer PWM */ HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); } void app_buzzer_beep() { // TODO make this non-blocking TIM2->ARR = 25714; TIM2->CCR1 = TIM2->ARR/2; vTaskDelay(50); TIM2->CCR1 = 0; vTaskDelay(50); }