42 lines
1.2 KiB
C
42 lines
1.2 KiB
C
/*
|
||
music Task
|
||
|
||
*/
|
||
|
||
/* Includes ----------------------------------------------------------------- */
|
||
#include "bsp/time.h"
|
||
#include "task/user_task.h"
|
||
/* USER INCLUDE BEGIN */
|
||
#include "device/buzzer.h"
|
||
#include "bsp/pwm.h"
|
||
/* USER INCLUDE END */
|
||
|
||
/* Private typedef ---------------------------------------------------------- */
|
||
/* Private define ----------------------------------------------------------- */
|
||
/* Private macro ------------------------------------------------------------ */
|
||
/* Private variables -------------------------------------------------------- */
|
||
/* USER STRUCT BEGIN */
|
||
BUZZER_t buzzer;
|
||
/* USER STRUCT END */
|
||
|
||
/* Private function --------------------------------------------------------- */
|
||
/* Exported functions ------------------------------------------------------- */
|
||
void Task_music(void *argument) {
|
||
(void)argument; /* 未使用argument,消除警告 */
|
||
|
||
|
||
osDelay(MUSIC_INIT_DELAY); /* 延时一段时间再开启任务 */
|
||
|
||
/* USER CODE INIT BEGIN */
|
||
BUZZER_Init(&buzzer, BSP_PWM_BUZZER);
|
||
BUZZER_PlayMusic(&buzzer, MUSIC_RM);
|
||
|
||
/* USER CODE INIT END */
|
||
|
||
while (1) {
|
||
/* USER CODE BEGIN */
|
||
|
||
/* USER CODE END */
|
||
}
|
||
|
||
} |