From 503ec4c2d6ddb0414c77fc2af82a197ba31dad20 Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Thu, 25 Jan 2024 17:13:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9emmc=E5=92=8Csd=E5=8D=A1?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build_all.sh | 6 +++--- .../source/cardv/SrcCode/System/SysStrg_CB.c | 2 ++ .../source/cardv/SrcCode/System/SysStrg_Exe.c | 1 + .../UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c | 11 ++++++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/build_all.sh b/build_all.sh index 021b279f6..1b9785abd 100755 --- a/build_all.sh +++ b/build_all.sh @@ -1,7 +1,7 @@ #!/bin/bash #用于gitlab-ci.yml编译使用 -make app_clean +#make app_clean echo "Start compile." export ROOT_PATH=$PWD @@ -9,7 +9,7 @@ export ROOT_PATH=$PWD cd rtos source build/envsetup.sh lunch rtos cfg_565_HUNTING_EVB_LINUX_4G_S550 gcc-6.5-newlib-2.4-2019.11-arm-ca9-eabihf -make clean +#make clean bear make all > /dev/null cp output/application.bin ../ cp output/rtos-main.bin ../ @@ -18,7 +18,7 @@ cp output/rtos-main.bin ../ cd $ROOT_PATH source build/envsetup.sh lunch Linux cfg_565_HUNTING_EVB_LINUX_4G_S550 arm-ca9-linux-uclibcgnueabihf-8.4.01 -make clean +#make clean bear make all > /dev/null cd $ROOT_PATH diff --git a/code/application/source/cardv/SrcCode/System/SysStrg_CB.c b/code/application/source/cardv/SrcCode/System/SysStrg_CB.c index 8095a2660..1ca1a7315 100755 --- a/code/application/source/cardv/SrcCode/System/SysStrg_CB.c +++ b/code/application/source/cardv/SrcCode/System/SysStrg_CB.c @@ -48,6 +48,7 @@ void Strg_CB(UINT32 event, UINT32 param1, UINT32 param2); void Strg_CB(UINT32 event, UINT32 param1, UINT32 param2) { + printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); UINT32 status; #if HUNTING_CAMERA_MCU == ENABLE @@ -74,6 +75,7 @@ void Strg_CB(UINT32 event, UINT32 param1, UINT32 param2) } #endif //#NT#2016/03/02#Niven Cho -end + Ux_PostEvent(NVTEVT_STRG_INSERT, 1, param1); break; case STRG_CB_REMOVED: //call after card removed diff --git a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index 6e6d38efd..b46305f13 100644 --- a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -693,6 +693,7 @@ int search_str_in_file(char *path, char *str) int System_check_mmcblk0p1(void) { SysMain_system("ls /dev/mmcblk0p1 > /tmp/lsdev.txt"); + printf("\n====================================================="); vos_util_delay_ms(100); if (search_str_in_file("/tmp/lsdev.txt", "/dev/mmcblk0p1")) { return 1; 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 c2c47f429..ced15eac7 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 @@ -76,6 +76,8 @@ static BOOL g_SysStrg_Chg = true; static int cnt = 0; static int first_check_storage = 1; +//UINT32 dcf_handle = -1; + #define FREE_SIZE_MB 30 static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key); @@ -755,7 +757,7 @@ static void update_sd_emmc_status(void) diskFreeEmmc = FileSys_GetDiskInfoEx('B', FST_INFO_FREE_SPACE); } lv_obj_set_hidden(label_7_scr_uiflowphoto, showError); - //lv_obj_set_pos(label_7_scr_uiflowphoto, 65, 171); + //lv_obj_set_x(label_7_scr_uiflowphoto, 65); lv_label_set_text(label_7_scr_uiflowphoto, ""); set_warning_label_text(label_7_scr_uiflowphoto); @@ -791,6 +793,7 @@ static void update_sd_emmc_status(void) idRight = LV_PLUGIN_IMG_ID_SF_SD_EMMC_DIS; textLabel = "No SD Card"; textLabelError = "EMMC Error, Please format it"; + lv_obj_set_x(label_7_scr_uiflowphoto, 65); setWarning = true; showError = false; } @@ -835,6 +838,7 @@ static void update_sd_emmc_status(void) UIStorageCheck(STORAGE_CHECK_FULL, &g_uiFreePicNum); textLabel = Get_FreePicNumString(g_uiFreePicNum); textLabelError = "SD Card Error, Please format it"; + lv_obj_set_x(label_7_scr_uiflowphoto, 56); setWarning = false; showError = false; } @@ -855,6 +859,7 @@ static void update_sd_emmc_status(void) UIStorageCheck(STORAGE_CHECK_FULL, &g_uiFreePicNum); textLabel = Get_FreePicNumString(g_uiFreePicNum); textLabelError = "EMMC Error, Please format it"; + lv_obj_set_x(label_7_scr_uiflowphoto, 62); setWarning = false; showError = false; } @@ -865,6 +870,7 @@ static void update_sd_emmc_status(void) textLabel = "SD CARD Error"; lv_obj_set_pos(label_7_scr_uiflowphoto, 10, 171); textLabelError = "EMMC and SD Card Error, Please format it"; + lv_obj_set_x(label_7_scr_uiflowphoto, 10); setWarning = true; showError = false; } @@ -874,6 +880,7 @@ static void update_sd_emmc_status(void) idRight = LV_PLUGIN_IMG_ID_SF_SD_EMMC_DIS; textLabel = "SD CARD Full"; textLabelError = "EMMC Error, Please format it"; + lv_obj_set_x(label_7_scr_uiflowphoto, 62); setWarning = true; showError = false; } @@ -894,6 +901,7 @@ static void update_sd_emmc_status(void) idRight = LV_PLUGIN_IMG_ID_SF_EMMC_FULL; textLabel = "SD CARD Error"; textLabelError = "SD Card Error, Please format it"; + lv_obj_set_x(label_7_scr_uiflowphoto, 62); setWarning = true; showError = false; } @@ -2009,6 +2017,7 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) return ; } +} static void sf_show_send_text(lv_obj_t* obj, const unsigned short status) { #define SENDING_KEEP_SHOW_TIME_S 3 From cf3d4f91d4ff66ae74141b89a0bd12ac5f56caf1 Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Thu, 25 Jan 2024 17:22:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 ced15eac7..c7fe1f306 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 @@ -76,7 +76,6 @@ static BOOL g_SysStrg_Chg = true; static int cnt = 0; static int first_check_storage = 1; -//UINT32 dcf_handle = -1; #define FREE_SIZE_MB 30 @@ -2017,7 +2016,7 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) return ; } -} + static void sf_show_send_text(lv_obj_t* obj, const unsigned short status) { #define SENDING_KEEP_SHOW_TIME_S 3 From 3c1083515731f7a8bb963521e8134100746a5768 Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Thu, 25 Jan 2024 19:19:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=BF=E7=94=A8sd=E5=8D=A1=E6=97=B6?= =?UTF-8?q?=E5=BD=95=E5=83=8F=E6=8B=94=E5=87=BAsd=E5=8D=A1=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowMovie/UIFlowMovieEventCallback.c | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovieEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovieEventCallback.c index 0c5aa5dbd..f12718f2a 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovieEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovieEventCallback.c @@ -30,6 +30,10 @@ static BOOL g_BgInitFileSys = FALSE; uint16_t warn_msgbox_auto_close_ms = 1000 * 3; uint32_t warn_msgbox_auto_infinite_ms = 0xffffffff; +UINT32 dcf_handle = -1; +static void UIFlowMovie_REC_FINISH(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg); +extern DCF_HANDLE System_Get_DCF_Handle(void); + //MOVIE_SIZE_TAG static CHAR *resolution_Buf[MOVIE_SIZE_ID_MAX] = { @@ -705,6 +709,7 @@ static void set_indev_keypad_group(lv_obj_t* obj) static void UIFlowMovie_ScrOpen(lv_obj_t* obj) { + dcf_handle = (UINT32)System_Get_DCF_Handle();/* 0 emmc 1 sd*/ DBG_DUMP("%s\r\n", __func__); // #if HUNTING_CAMERA_MCU == ENABLE @@ -904,13 +909,10 @@ static void UIFlowMovie_ScrClose(lv_obj_t* obj) static void UIFlowMovie_OnExeRecord(lv_obj_t* obj) { if (System_GetState(SYS_STATE_POWERON) == SYSTEM_POWERON_SAFE) { - - // if (System_GetState(SYS_STATE_CARD) == CARD_REMOVED) { - - // UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms); - // return; - // } - + if (1 == dcf_handle && System_GetState(SYS_STATE_CARD) == CARD_REMOVED) { + //UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms); + printf("[%s:%d] card removed\n", __FUNCTION__, __LINE__); + } } else if (System_GetState(SYS_STATE_POWERON) == SYSTEM_POWERON_NORMAL) { if (GxStrg_GetDeviceCtrl(0, CARD_READONLY)) { // card lock @@ -920,11 +922,10 @@ static void UIFlowMovie_OnExeRecord(lv_obj_t* obj) } - // if (System_GetState(SYS_STATE_CARD) == CARD_REMOVED) { - - // UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms); - // return; - // } + if (1 == dcf_handle && System_GetState(SYS_STATE_CARD) == CARD_REMOVED) { + //UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms); + printf("[%s:%d] card removed\n", __FUNCTION__, __LINE__); + } } @@ -1178,10 +1179,17 @@ static void UIFlowMovie_WR_ERROR(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* set_rec_status(false); update_max_rec_time(); lv_obj_set_hidden(image_rec_ellipse_scr_uiflowmovie, true); + if (1 == dcf_handle && System_GetState(SYS_STATE_CARD) == CARD_REMOVED) { + //UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms); + printf("[%s:%d] card removed\n", __FUNCTION__, __LINE__); + lv_group_send_data(gp, LV_KEY_ENTER); + return; + } if (System_GetState(SYS_STATE_CARD) == CARD_LOCKED) { gMovData.State = MOV_ST_WARNING_MENU; UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_IMG_ID_ICON_SD_LOCK, warn_msgbox_auto_close_ms); } else { + gMovData.State = MOV_ST_WARNING_MENU; UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_MEMORYERROR, warn_msgbox_auto_close_ms); }