From 5bb1d3983c3560a9623269f80ecf0e18069afb4f Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Wed, 29 Nov 2023 11:38:07 +0800 Subject: [PATCH] Fixed bug number 10195. --- .../UIFlowMenuCommonItemEventCallback.c | 2 ++ .../UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c | 6 ++++-- code/lib/source/sifar/code/include/sf_common.h | 5 +++-- code/lib/source/sifar/code/source/common/sf_common.c | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c index ddeec51d5..7c3f25004 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c @@ -867,6 +867,7 @@ static void LV_MenuCommonItem_UpdateContent(TM_MENU *pMenu) static void UIFlowMenuCommonItem_ScrOpen(lv_obj_t* obj) { DBG_DUMP("UIFlowMenuCommonItem_ScrOpen\r\n"); + sf_set_keep_alive_time(MENU_SCREEN_GO_TO_WORK_MODE_TIME_S); gBattery = sf_cardv_battery_value_get(); /*********************************************************************************** @@ -990,6 +991,7 @@ static void UIFlowMenuCommonItem_Key(lv_obj_t* obj, uint32_t key) static void UIFlowMenuCommonItem_ScrClose(lv_obj_t* obj) { DBG_DUMP("%s\r\n", __func__); + sf_set_keep_alive_time(DEFAULT_GO_TO_WORK_MODE_TIME_S); Save_MenuInfo(); LV_MenuItem_OnClose(obj); gMenuLuck = MENU_CLOSED; diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c index f49e869cd..f8fb8c096 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c @@ -47,8 +47,9 @@ static CHAR g_cSelftimerCntStr[8] = {0}; static lv_group_t* gp = NULL; static lv_task_t* task_selftimer = NULL; static lv_task_t* update_icons_timer = NULL; -#define GO_TO_WORK_MODE_TIME 157 +#define GO_TO_WORK_MODE_TIME 57 #define PASSWORD_GO_TO_WORK_MODE_TIME_S 62 +#define MENU_GO_TO_WORK_MODE_TIME_S 27 static unsigned int ShutDownTime = GO_TO_WORK_MODE_TIME; static lv_task_t* task_qview = NULL; @@ -1565,7 +1566,7 @@ static void task_update_icons_timer_cb(lv_task_t* task) if (autoOffTime >= ShutDownTime && autoOffTime < ShutDownTime + 3) { // unsigned int autoCloseTime_s = ShutDownTime == GO_TO_WORK_MODE_TIME ? 30 : 3; - if (GO_TO_WORK_MODE_TIME == ShutDownTime) + if (GO_TO_WORK_MODE_TIME == ShutDownTime || MENU_GO_TO_WORK_MODE_TIME_S == ShutDownTime) { UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_ENTER_WORK, 1000 * 30); } @@ -1846,6 +1847,7 @@ static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key) case LV_USER_KEY_RIGHT: { SF_WIFI_STATUS_E status = sf_get_wifi_status(); + ShutDownTime = MENU_GO_TO_WORK_MODE_TIME_S; if (SF_WIFI_CON != status) { UIFlowPhoto_OnKeyMenu(obj); diff --git a/code/lib/source/sifar/code/include/sf_common.h b/code/lib/source/sifar/code/include/sf_common.h index e2c2b645e..b5f570747 100755 --- a/code/lib/source/sifar/code/include/sf_common.h +++ b/code/lib/source/sifar/code/include/sf_common.h @@ -30,8 +30,9 @@ typedef enum{ FILE_SENDING_GUI_SEND_FAILED, FILE_SENDING_GUI_END } FILE_SENDING_GUI_E; -#define DEFAULT_GO_TO_WORK_MODE_TIME_S 185 -#define PASSWORD_SCREEN_GO_TO_WORK_MODE_TIME_S 60 +#define DEFAULT_GO_TO_WORK_MODE_TIME_S 85 +#define PASSWORD_SCREEN_GO_TO_WORK_MODE_TIME_S 61 +#define MENU_SCREEN_GO_TO_WORK_MODE_TIME_S 60 void sf_mode_detect(void); int sf_pir_statu_read(void); void sf_set_pir_power_off_flag(BOOL flag); diff --git a/code/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index 6a0861231..a28b600bf 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -311,7 +311,9 @@ void sf_mode_detect(void) //countDownOffFlg = 0; } - if(puiPara->AutoOffSwitch == 0 || SF_BLE_CON == sf_get_ble_status() || (0x04 == NetWorkFlag/*SF_4G_SENDING*/) || (0x05 == NetWorkFlag/*SF_4G_SEARCHING*/) || (sf_get_fw_update()) || (sf_get_module_update()) || (sf_get_mcu_update_flag())/*|| (appActiveStateGet() == APP_STATE_CUSTOMER_TRANSFER)*/) + if(puiPara->AutoOffSwitch == 0 || SF_BLE_CON == sf_get_ble_status() || (0x04 == NetWorkFlag/*SF_4G_SENDING*/) || + (0x05 == NetWorkFlag/*SF_4G_SEARCHING*/) || (sf_get_fw_update()) || (sf_get_module_update()) || + (sf_get_mcu_update_flag()) || ( System_GetState(SYS_STATE_CURRMODE) == PRIMARY_MODE_PLAYBACK)/*|| (appActiveStateGet() == APP_STATE_CUSTOMER_TRANSFER)*/) { AutoOfftime=0; }