From 7f2b5dfcc0d98e917ac6be48ecb3251ad611e9b1 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Fri, 17 Nov 2023 14:21:00 +0800 Subject: [PATCH] Closing screen ok. --- .../UIFlowClose/UIFlowCloseEventCallback.c | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c index 977d5be9e..8e4dd30e4 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c @@ -1,5 +1,6 @@ #include "UIFlowLVGL/UIFlowLVGL.h" #include +#include #define UPDATE_TIMEER_MS 200 static lv_task_t* update_timer = NULL; static lv_group_t* gp = NULL; @@ -16,23 +17,19 @@ static void set_indev_keypad_group(lv_obj_t* obj) static void task_update_timer_cb(lv_task_t* task) { - // static short closing_index = 0; - // static unsigned int time_ms = 3 * 1000; - // #define BUFF_LENGTH 32 - // char buf[BUFF_LENGTH] = {0}; - // lv_plugin_res_id res[] = { - // LV_PLUGIN_IMG_ID_SF_BUSY_1, - // LV_PLUGIN_IMG_ID_SF_BUSY_2, - // LV_PLUGIN_IMG_ID_SF_BUSY_3, - // LV_PLUGIN_IMG_ID_SF_BUSY_4 - // }; - // closing_index = closing_index % 4; - // lv_plugin_img_set_src(image_closing_scr_uiflowclose, res[closing_index]); - // snprintf(buf, BUFF_LENGTH, "%ss", time_ms / 1000); - // lv_label_set_text(label_1_scr_uiflowclose, buf); - // // lv_plugin_label_set_text(); - // time_ms -= UPDATE_TIMEER_MS; - // closing_index ++; + static short closing_index = 0; + static unsigned int time_ms = 3 * 1000; + lv_plugin_res_id res[] = { + LV_PLUGIN_IMG_ID_SF_BUSY_1, + LV_PLUGIN_IMG_ID_SF_BUSY_2, + LV_PLUGIN_IMG_ID_SF_BUSY_3, + LV_PLUGIN_IMG_ID_SF_BUSY_4 + }; + closing_index = closing_index % 4; + lv_plugin_img_set_src(image_closing_scr_uiflowclose, res[closing_index]); + lv_label_set_text_fmt(label_1_scr_uiflowclose, "%ds", time_ms / 1000); + time_ms -= UPDATE_TIMEER_MS; + closing_index ++; } void OpenClosingScreen(void) {