UP 模拟器 加入key的模拟支持

This commit is contained in:
JiXieShi
2024-06-22 22:51:58 +08:00
parent 0c7c6bb1e9
commit 5876461531
9 changed files with 201 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
#ifndef HW_LIB_KEY_H
#ifndef HW_LIB_SIM_KEY_H
#define HW_LIB_KEY_H
#ifdef __cplusplus
extern "C" {
@@ -8,7 +8,7 @@ extern "C" {
#include <string.h>
#define KEY_TICKS_INTERVAL 5 // 定时器间隔时间,单位为毫秒
#define DEBOUNCE_TICKS 3 // 按键去抖动计数阈值最大为70 ~ 7
#define DEBOUNCE_TICKS 0 // 按键去抖动计数阈值最大为70 ~ 7
#define SHORT_TICKS (300 / KEY_TICKS_INTERVAL) // 短按阈值,单位为定时器间隔的倍数
#define LONG_TICKS (1000 / KEY_TICKS_INTERVAL) // 长按阈值,单位为定时器间隔的倍数
#define KEY_STOP_FREE 1 // 按键停止释放状态标识
@@ -99,4 +99,4 @@ void key_ticks(void);
#ifdef __cplusplus
}
#endif
#endif //HW_LIB_KEY_H
#endif //HW_LIB_SIM_KEY_H