From 1618bf0a509c427b4458e9614f270e8bfe6db65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=90=83=E6=B2=B9=E7=82=B8=E9=B8=A1?= <1425962791@qq.com> Date: Tue, 7 Oct 2025 10:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E7=BD=AEtimecount=EF=BC=8Cdeinit?= =?UTF-8?q?=E6=97=B6=E7=BD=AE0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Power_Pico/User/GUI/screens/ui_mainPage.c | 28 +++++++---------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/Power_Pico/User/GUI/screens/ui_mainPage.c b/Power_Pico/User/GUI/screens/ui_mainPage.c index dfe0461..e8e1954 100644 --- a/Power_Pico/User/GUI/screens/ui_mainPage.c +++ b/Power_Pico/User/GUI/screens/ui_mainPage.c @@ -21,6 +21,8 @@ static lv_obj_t * ui_ButTime = NULL; static lv_obj_t * ui_LabelTime = NULL; static lv_timer_t * _flush_timer = NULL; +static uint8_t timecount = 0; + // other funtions static void full_screen_refresh(void) { @@ -103,9 +105,8 @@ static void set_val_cur_label(float voltage, float current) static void _flush_timer_cb() { - static uint8_t timecount = 0; timecount++; - if(timecount >= 10) { // 5s + if(timecount >= 4) { // 2s timecount = 0; full_screen_refresh(); } @@ -238,27 +239,14 @@ void ui_main_screen_init(void) void ui_main_screen_destroy(void) { - if(ui_HomeScreen) lv_obj_del(ui_HomeScreen); - - // NULL screen variables - ui_HomeScreen = NULL; - ui_ButVal = NULL; - ui_LabelUnitVal = NULL; - ui_LabelValt = NULL; - ui_ButCur = NULL; - ui_LabelUnitCur = NULL; - ui_LabelCur = NULL; - ui_ButEnerge = NULL; - ui_LabelUnitEnerge = NULL; - ui_LabelEnerge = NULL; - ui_ButTime = NULL; - ui_LabelTime = NULL; + timecount = 0; lv_timer_del(_flush_timer); - _flush_timer = NULL; - } +#include "key.h" void ui_main_page_key_handler(uint8_t key_id) { - // nothing to do + if(key_id == KEYB_NUM) { + PageManager_next(); + } }