mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
更新按键
This commit is contained in:
@@ -27,11 +27,12 @@ static uint8_t timecount = 0;
|
||||
// other funtions
|
||||
|
||||
#include "key.h"
|
||||
void ui_main_page_key_handler(uint8_t key_id)
|
||||
void ui_main_page_key_handler(void* key_event)
|
||||
{
|
||||
if(key_id == KEYB_NUM) {
|
||||
if(((key_event_t*)key_event)->id == KEY_ID_B) {
|
||||
lv_lib_pm_next();
|
||||
} else if (key_id == KEYL_NUM) {
|
||||
} else if (((key_event_t*)key_event)->id == KEY_ID_L &&
|
||||
((key_event_t*)key_event)->type == KEY_EVT_CLICK) {
|
||||
// rotation - 90 degrees
|
||||
// rotation – LV_DISPLAY_ROTATION_0/90/180/270
|
||||
uint16_t rotation = ui_get_display_rotation();
|
||||
@@ -41,7 +42,8 @@ void ui_main_page_key_handler(uint8_t key_id)
|
||||
// save settings to eeprom
|
||||
ui_system_settings_save();
|
||||
ui_full_screen_refresh(ui_HomeScreen);
|
||||
} else if (key_id == KEYR_NUM) {
|
||||
} else if (((key_event_t*)key_event)->id == KEY_ID_R &&
|
||||
((key_event_t*)key_event)->type == KEY_EVT_CLICK) {
|
||||
// rotation + 90 degrees
|
||||
uint16_t rotation = ui_get_display_rotation();
|
||||
rotation = (rotation + 360 + 90) % 360;
|
||||
|
||||
Reference in New Issue
Block a user