mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
移动文件夹
This commit is contained in:
41
software/Power_Pico/User/Tasks/Src/user_KeyTask.c
Normal file
41
software/Power_Pico/User/Tasks/Src/user_KeyTask.c
Normal file
@@ -0,0 +1,41 @@
|
||||
/* Private includes -----------------------------------------------------------*/
|
||||
//includes
|
||||
#include "user_TasksInit.h"
|
||||
#include "main.h"
|
||||
#include "key.h"
|
||||
#include "beep.h"
|
||||
#include "BL24C02.h" // settings
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Key press check task
|
||||
* @param argument: Not used
|
||||
* @retval None
|
||||
*/
|
||||
void KeyTask(void *argument)
|
||||
{
|
||||
key_event_t key_event;
|
||||
while(1)
|
||||
{
|
||||
if(Key_Scan(&key_event))
|
||||
{
|
||||
osMessageQueuePut(Key_MessageQueue, &key_event, 0, 1);
|
||||
// beep
|
||||
if(Sys_Get_KeySoundEnable())
|
||||
{
|
||||
beep_open();
|
||||
osDelay(50);
|
||||
beep_close();
|
||||
}
|
||||
}
|
||||
osDelay(10);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user