From 02af726fb72ced0744726857da18959e2361f2f1 Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Wed, 3 Jan 2024 10:43:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?9842,10801=20=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98,=20?= =?UTF-8?q?=E5=9B=9E=E6=94=BE=E7=95=8C=E9=9D=A2=E8=AE=BE=E7=BD=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=9C=AA=E6=8F=92=E5=8D=A1=E5=8F=98=E7=81=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c | 8 +-- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 2 +- .../UIFlowPlay/UIFlowPlayEventCallback.c | 51 +++++++++++++------ 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c index 871e907e3..d095bcf26 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c @@ -694,7 +694,7 @@ static void qr_page_task_cb(lv_task_t* task){ { UIMenuStoreInfo *puiPara = sf_ui_para_get(); printf("[qr_page_task_cb]is esim card...%s\n", puiPara->ModuleImei); - if(strlen(puiPara->SimIccidV) == 0 && strlen(puiPara->SimIccidA) == 0) + if (strlen(puiPara->SimIccid) == 0 || strlen(puiPara->ModuleImei) == 0) { lv_label_set_text(labelInit, "Please restart the camera"); return; @@ -705,16 +705,16 @@ static void qr_page_task_cb(lv_task_t* task){ { UIMenuStoreInfo *puiPara = sf_ui_para_get(); printf("[qr_page_task_cb]is sim card...%s\n", puiPara->ModuleImei); - if(strlen(puiPara->SimIccidV) == 0 && strlen(puiPara->SimIccidA) == 0) + if (strlen(puiPara->SimIccid) == 0 || strlen(puiPara->ModuleImei) == 0) { - lv_label_set_text(labelInit, "Please insert SIM card and restart the camera"); + lv_label_set_text(labelInit, "Please restart the camera"); return; } snprintf(qr_date, QR_DATA_LENGTH, qr_code_str, puiPara->ModuleImei, puiPara->SimIccidV, puiPara->SimIccidA, "false"); } else if (ret == -1) { - if(sf_cardv_4G_status_get() == SF_4G_SEARCHING) + if (sf_cardv_4G_status_get() == SF_4G_SEARCHING) { lv_label_set_text(labelInit, "\nQR code loading..."); } 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 7909f6344..926504ab6 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 @@ -697,7 +697,7 @@ static void update_storage_sd_card(void) { static int cnt = 0; if(cnt++<1){ - lv_label_set_text(label_6_scr_uiflowphoto, "Loarding..."); + lv_label_set_text(label_6_scr_uiflowphoto, ""); }else{ g_SysStrg_Chg = false; cnt = 0; diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c index 3a5e2587a..d72764187 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c @@ -27,7 +27,7 @@ //#define PLAY_KEY_PRESS_MASK (FLGKEY_KEY_MASK_DEFAULT) //#define PLAY_KEY_RELEASE_MASK FLGKEY_KEY_MASK_NULL//(FLGKEY_UP | FLGKEY_DOWN | FLGKEY_LEFT | FLGKEY_RIGHT) //#define PLAY_KEY_CONTINUE_MASK FLGKEY_KEY_CONT_MASK_DEFAULT -static SF_ST_MMC_DEV *mmc_dev = NULL; +extern int System_Get_DCF_Handle(void); //static lv_obj_t* pMenu = NULL; enum SELECTION_SHOW { @@ -60,6 +60,9 @@ extern void PBView_DrawNoFile(void); static void stop_play(void); //#NT#2023/11/14#Eric - end +#define HANDLE_SD 1 +#define HANDLE_EMMC 0 + static BOOL g_PlayBgInitFileSys = FALSE; #if 1 @@ -221,6 +224,22 @@ static void update_play_Selection_msg(lv_obj_t* obj) } } } + UINT32 cardStatus = System_GetState(SYS_STATE_CARD); + if (cardStatus == CARD_REMOVED && OPTION_PAGE_SELECT_FUNCTION != gOptionPage) + { + ProfileFocused = 0; + ProfileSelected = 0; + lv_obj_set_state(image_button_option_1_scr_uiflowplay, LV_STATE_FOCUSED); + lv_obj_set_state(label_option1_scr_uiflowplay, LV_STATE_FOCUSED); + + lv_plugin_img_set_src(image_option1_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_LIST_SELECTED); + lv_obj_set_pos(image_option2_scr_uiflowplay, 272, 0); + lv_obj_set_hidden(image_option1_scr_uiflowplay, false); + + lv_obj_set_state(image_button_option_2_scr_uiflowplay, LV_STATE_DISABLED); + lv_obj_set_state(label_option2_scr_uiflowplay, LV_STATE_DISABLED); + lv_obj_set_hidden(image_option2_scr_uiflowplay, true); + } } @@ -307,33 +326,23 @@ void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key) } else //GO TO STORAGE OPTIONS { - mmc_dev = SF_GetMMCDev(); - if (mmc_dev->dev_type == 0)//sd 0, emmc 1 - { - ProfileFocused = 1; - } - else - { - ProfileFocused = 0; - } - printf(" ================================== storage option init%d\n", ProfileSelected); ProfileFocused = ProfileSelected; gOptionPage = OPTION_PAGE_FORMAT; show_Selection_page(obj); } } else { - if (1 == ProfileFocused) + if (1 == ProfileFocused && ProfileSelected == 0) { printf(" ================================== switch sd card.\n"); ProfileSelected = 1; - FileDB_Refresh(0); + Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PLAYBACK); } - else + else if (0 == ProfileFocused && ProfileSelected == 1) { printf(" ================================== switch emmc.\n"); ProfileSelected = 0; - FileDB_Refresh(1); + Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PLAYBACK); } ProfileFocused = 0; hidde_Selection_page(); @@ -1272,7 +1281,17 @@ static void set_indev_keypad_group(lv_obj_t* obj) static void UIFlowPlay_ScrOpen(lv_obj_t* obj) { DBG_IND("UIFlowPlay_ScrOpen\r\n"); - + int SelectedHandle = System_Get_DCF_Handle(); + printf("[UIFlowPlay_ScrOpen][*x] select handle: %d.", SelectedHandle); + if (SelectedHandle == HANDLE_SD) + { + ProfileSelected = 1; + } + else if (SelectedHandle == HANDLE_EMMC) + { + ProfileSelected = 0; + } + set_indev_keypad_group(obj); if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE) { From f3606cd1908ba85635c0d1f9438f17aa5a98eb14 Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Wed, 3 Jan 2024 11:56:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=9B=9E=E6=94=BE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=B7=A6=E9=94=AE=E5=9B=9E=E9=80=80=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c | 8 +++++++- .../UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c | 3 ++- code/lib/source/sifar/code/source/common/sf_common.c | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c index 0f48c6eee..cf47ed9c1 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c @@ -298,6 +298,7 @@ void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key) } case LV_USER_KEY_LEFT: { + /* if (OPTION_PAGE_SELECT_FUNCTION == gOptionPage) { hidde_Selection_page(); @@ -307,6 +308,7 @@ void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key) gOptionPage = OPTION_PAGE_SELECT_FUNCTION; show_Selection_page(obj); } + */ break; } case LV_USER_KEY_RIGHT: @@ -337,12 +339,16 @@ void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key) printf(" ================================== switch sd card.\n"); ProfileSelected = 1; Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PLAYBACK); + int SelectedHandle = System_Get_DCF_Handle(); + printf("[Option_play_Selection_Key][*x] select handle: %d.\n", SelectedHandle); } else if (0 == ProfileFocused && ProfileSelected == 1) { printf(" ================================== switch emmc.\n"); ProfileSelected = 0; Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PLAYBACK); + int SelectedHandle = System_Get_DCF_Handle(); + printf("[Option_play_Selection_Key][*x] select handle: %d.\n", SelectedHandle); } ProfileFocused = 0; hidde_Selection_page(); @@ -1282,7 +1288,7 @@ static void UIFlowPlay_ScrOpen(lv_obj_t* obj) { DBG_IND("UIFlowPlay_ScrOpen\r\n"); int SelectedHandle = System_Get_DCF_Handle(); - printf("[UIFlowPlay_ScrOpen][*x] select handle: %d.", SelectedHandle); + printf("[UIFlowPlay_ScrOpen][*x] select handle: %d.\n", SelectedHandle); if (SelectedHandle == HANDLE_SD) { ProfileSelected = 1; diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c index 09c1522d5..40d64b6b4 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c @@ -45,7 +45,7 @@ static void task_msgbox_timer_cb(lv_task_t* task) if (0 == autoClose || autoOffTime <= 10) { - + printf("[task_msgbox_timer_cb][*x]auto close\n"); lv_task_del(msgbox_timer); msgbox_timer = NULL; @@ -56,6 +56,7 @@ static void task_msgbox_timer_cb(lv_task_t* task) } if (0 == autoClose) { + printf("[task_msgbox_timer_cb][*x]set statu flag\n"); sf_set_pir_statu_flag(1); // OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); //#define DO_NOT_SHOW_POWER_OFF 0 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 668eb0c87..84de572a5 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -278,6 +278,7 @@ void sf_mode_detect(void) } else if((sf_get_pir_statu_flag()) && (CMD_FORMAT_SD_STA != sf_get_card_statu())) { + printf("[sf_mode_detect][*x] empezar going to pir................................\n"); pwroffcnt++; //printf("[%s:%d]pwroffcnt=%d\n",__FUNCTION__,__LINE__,pwroffcnt); //sf_enter_auto_mode_count_down_show(4 - pwroffcnt); From ffb0d6be0d0e1c78b4296ae4b1072d90e643778e Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Wed, 3 Jan 2024 13:39:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E=E6=94=BE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E2=88=9A=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c index cf47ed9c1..6c9eefcca 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c @@ -233,7 +233,7 @@ static void update_play_Selection_msg(lv_obj_t* obj) lv_obj_set_state(label_option1_scr_uiflowplay, LV_STATE_FOCUSED); lv_plugin_img_set_src(image_option1_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_LIST_SELECTED); - lv_obj_set_pos(image_option2_scr_uiflowplay, 272, 0); + lv_obj_set_pos(image_option1_scr_uiflowplay, 272, 0); lv_obj_set_hidden(image_option1_scr_uiflowplay, false); lv_obj_set_state(image_button_option_2_scr_uiflowplay, LV_STATE_DISABLED);