feat: 完成按键、屏幕和蜂鸣器适配

This commit is contained in:
2024-01-31 17:20:09 +08:00
parent 7181da95de
commit 64e95d278c
31 changed files with 385 additions and 1338 deletions

View File

@@ -13,7 +13,7 @@
#include "zf_common_headfile.h"
#include "by_rt_button.h"
#include "by_button.h"
enum PageID {
PAGE_NULL = -1,
@@ -28,11 +28,11 @@ enum PageID {
page_max,
};
typedef enum page_event{
page_event_forward = rotate_button_forward,
page_event_backward = rotate_button_backward,
page_event_press_short = rotate_button_press_short,
page_event_press_long = rotate_button_press_long,
typedef enum page_event {
page_event_forward = button_event_up,
page_event_backward = button_event_down,
page_event_press_short = button_event_center_sp,
page_event_press_long = button_event_center_lp,
} page_event;
typedef void (*CallbackFunction_t)(void);
@@ -45,16 +45,16 @@ typedef struct {
EventFunction_t EventCallback;
} PAGE_LIST;
//页面注册函数
#define PAGE_REG(name)\
do{\
extern void PageRegister_##name(unsigned char pageID);\
PageRegister_##name(name);\
}while(0)
// 页面注册函数
#define PAGE_REG(name) \
do { \
extern void PageRegister_##name(unsigned char pageID); \
PageRegister_##name(name); \
} while (0)
void Page_Register(uint8_t pageID, char *pageText,
CallbackFunction_t setupCallback, CallbackFunction_t loopCallback,
CallbackFunction_t exitCallback, EventFunction_t eventCallback);
CallbackFunction_t setupCallback, CallbackFunction_t loopCallback,
CallbackFunction_t exitCallback, EventFunction_t eventCallback);
void Page_EventTransmit(unsigned char event);
void Page_Shift(unsigned char pageID);