From 787ee85bbd83d34998e17335cfdad679ad3009cd Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Mon, 18 Dec 2023 19:48:22 +0800 Subject: [PATCH 01/11] Gui Megre emmc branch. --- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 21 +++++++++++++++++++ .../sf_app/code/include/sf_commu_mcu_reg.h | 12 +++++++---- .../sf_app/code/include/sf_param_enum.h | 1 + .../source/sf_app/code/source/4gMng/sf_ftp.c | 8 ++++++- .../code/source/systemMng/sf_commu_mcu_reg.c | 8 +++++++ .../lib/source/sifar/code/include/sf_common.h | 8 +++++++ .../sifar/code/source/common/sf_common.c | 13 ++++++++++++ 7 files changed, 66 insertions(+), 5 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 bc02098b3..95734847e 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 @@ -642,6 +642,14 @@ static void update_gps_status(void) sf_show_send_text(UIFlowPhoto, FILE_SENDING_GUI_START_SENDING); return; } + if (FTP_CONNECTING_FTP_CONNECTING == sf_cardv_get_ftp_status()) + { + sf_show_send_text(UIFlowPhoto, FTP_CONNECTING_FTP_CONNECTING); + return; + } + else if (FTP_CONNECTING_END != sf_cardv_get_ftp_status()) { + sf_show_send_text(UIFlowPhoto, sf_cardv_get_ftp_status()); + } SF_GPS_STATUS_E status = sf_cardv_get_gps_status(); switch (status) { @@ -1764,6 +1772,19 @@ static void sf_show_send_text(lv_obj_t* obj, const unsigned short status) SendMsgShow = SENDING_KEEP_SHOW_TIME_S; break; } + case FTP_CONNECTING_FTP_CONNECTING: + { + lv_obj_set_hidden(label_sim_scr_uiflowphoto, false); + lv_label_set_text(label_sim_scr_uiflowphoto, "Connecting ... "); + SendMsgShow = SENDING_KEEP_SHOW; + break; + } + case FTP_CONNECTING_FTP_CONNECT_SUCCESSFUL: + case FTP_CONNECTING_FTP_CONNECT_FAILED: + { + SendMsgShow = SENDING_NOT_SHOW; + break; + } default: break; } diff --git a/code/application/source/sf_app/code/include/sf_commu_mcu_reg.h b/code/application/source/sf_app/code/include/sf_commu_mcu_reg.h index 168b4f990..315c88769 100755 --- a/code/application/source/sf_app/code/include/sf_commu_mcu_reg.h +++ b/code/application/source/sf_app/code/include/sf_commu_mcu_reg.h @@ -357,11 +357,15 @@ void sf_set_module_sleep_flag(UINT8 flag); UINT8 sf_get_module_sleep_flag(void); int sf_app_while_flag(void); void sf_set_sim_insert(INT32 sim); - #define GPS_SEARCHING_START 0 - #define GPS_SEARCHING_STOP 1 - #define GPS_SEARCHING_SUCCESSFUL 2 - #define GPS_SEARCHING_FAILED 3 +#define GPS_SEARCHING_START 0 +#define GPS_SEARCHING_STOP 1 +#define GPS_SEARCHING_SUCCESSFUL 2 +#define GPS_SEARCHING_FAILED 3 void sf_set_gps_status(const short status); +#define FTP_CONNECTING 4 +#define FTP_CONNECT_SUCCESSFUL 5 +#define FTP_CONNECT_FAILED 6 +void sf_set_ftp_status(const short status); void sf_set_usb_init(int flag); UINT32 sf_get_sim_insert(void); int sf_get_signal_ready(void); diff --git a/code/application/source/sf_app/code/include/sf_param_enum.h b/code/application/source/sf_app/code/include/sf_param_enum.h index 0e39a30f5..b337a9a7e 100755 --- a/code/application/source/sf_app/code/include/sf_param_enum.h +++ b/code/application/source/sf_app/code/include/sf_param_enum.h @@ -487,6 +487,7 @@ typedef enum sf_PARA_MESSAGE_TYPE_E SF_PARA_CMD_ISESIM = 0x1F07, SF_PARA_CMD_USB_INIT = 0x1F08, SF_PARA_CMD_GPS_STATUS = 0X1F09, + SF_PARA_CMD_FTP_CONNECT_STATUS= 0X1F0A, }SF_PARA_MESSAGE_TYPE_E; typedef enum sf_WIFI_MESSAGE_TYPE_E diff --git a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c index e372ae237..cb06c5105 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c @@ -1415,6 +1415,7 @@ SINT32 sf_4g_module_ota_ftp(void) *************************************************/ SINT32 sf_connect_ftps_server(void) { + sf_set_ftp_status(FTP_CONNECTING); SINT32 ret = SF_SUCCESS;//0:success; else:fail; UINT8 ssl = 0; UINT8 gprsMode = 0; @@ -1441,8 +1442,13 @@ SINT32 sf_connect_ftps_server(void) if(FTP_MANAGER_SERVICE_AVAILABLE == result) { FtpOpenOk = SUCCESS; + sf_set_ftp_status(FTP_CONNECT_SUCCESSFUL); } - //ret = sf_ftp_stop(ssl, gprsMode); + else + { + sf_set_ftp_status(FTP_CONNECT_FAILED); + } + ret = sf_ftp_stop(ssl, gprsMode); //SF_FTP_CONNECT_END: //printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret); diff --git a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c index 38036be30..1ae43890e 100755 --- a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c +++ b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c @@ -1256,6 +1256,14 @@ void sf_set_gps_status(const short status) stMessageBuf.cmdId = CMD_PARA; sf_com_message_send_to_cardv(&stMessageBuf); } +void sf_set_ftp_status(const short status) +{ + SF_MESSAGE_BUF_S stMessageBuf = {0}; + stMessageBuf.arg2 = status; + stMessageBuf.arg1 = SF_PARA_CMD_FTP_CONNECT_STATUS; + stMessageBuf.cmdId = CMD_PARA; + sf_com_message_send_to_cardv(&stMessageBuf); +} void sf_set_usb_init(int flag) { SF_MESSAGE_BUF_S stMessageBuf = {0}; diff --git a/code/lib/source/sifar/code/include/sf_common.h b/code/lib/source/sifar/code/include/sf_common.h index 47409f9ca..4694c25be 100755 --- a/code/lib/source/sifar/code/include/sf_common.h +++ b/code/lib/source/sifar/code/include/sf_common.h @@ -40,6 +40,12 @@ typedef enum{ FILE_SENDING_GUI_SEND_FAILED, FILE_SENDING_GUI_END } FILE_SENDING_GUI_E; +typedef enum{ + FTP_CONNECTING_FTP_CONNECTING = FILE_SENDING_GUI_END, + FTP_CONNECTING_FTP_CONNECT_SUCCESSFUL, + FTP_CONNECTING_FTP_CONNECT_FAILED, + FTP_CONNECTING_END +} FTP_CONNECTING_E; #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 @@ -126,6 +132,8 @@ BOOL sf_is_preview(void); short sf_cardv_get_cq_signal(void); void sf_cardv_set_gps_status(const SF_GPS_STATUS_E status); const SF_GPS_STATUS_E sf_cardv_get_gps_status(void); +void sf_cardv_set_ftp_status(const FTP_CONNECTING_E status); +const FTP_CONNECTING_E sf_cardv_get_ftp_status(void); void sf_cardv_4G_status_set(UINT8 status); UINT8 sf_cardv_4G_status_get(void); void sf_cardv_set_sim_insert(INT8 sim); 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 2b63c91ca..7d8f1a314 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -100,6 +100,7 @@ static UINT8 UiparaFlag = 0; static SF_BLE_STATUS_E BleStatus = SF_BLE_OK; static UINT8 McuUpdateFlag = 0; static SF_GPS_STATUS_E gGpsSearching = SF_GPS_SEARCHING_UNKNOW; +static FTP_CONNECTING_E gFtpConnectingStatus = FTP_CONNECTING_END; static char CamMode = 0; static CHAR netGeneration = SF_NET_NO; static SF_THREAD_S UpgradeTskParam = @@ -1542,6 +1543,15 @@ const SF_GPS_STATUS_E sf_cardv_get_gps_status(void) { return gGpsSearching; } +void sf_cardv_set_ftp_status(const FTP_CONNECTING_E status) +{ + printf("sf_cardv_set_ftp_status = %d\n", status); + gFtpConnectingStatus = status; +} +const FTP_CONNECTING_E sf_cardv_get_ftp_status(void) +{ + return gFtpConnectingStatus; +} /************************************************* Function: sf_cardv_adc_value_get @@ -1784,6 +1794,9 @@ static SINT32 sf_cardv_proccess_cmd_para_update(SF_MESSAGE_BUF_S *pMessageBuf) break; case SF_PARA_CMD_GPS_STATUS: sf_cardv_set_gps_status(pMessageBuf->arg2); + break; + case SF_PARA_CMD_FTP_CONNECT_STATUS: + sf_cardv_set_ftp_status(pMessageBuf->arg2); break; default: break; From 60a77deb0d4bce58ce84d00de066a10b850a6009 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Tue, 19 Dec 2023 10:38:42 +0800 Subject: [PATCH 02/11] Fixed bug number 10539. --- .../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 c9dc59fba..1503713f0 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 @@ -115,7 +115,7 @@ static void UIFlowPlay_IconImageSize(BOOL bShow) if (bShow == FALSE) { // UxCtrl_SetShow(&UIFlowWndPlay_StaticTXT_SizeCtrl, FALSE); lv_obj_set_hidden(label_file_size_scr_uiflowplay, true); - lv_obj_set_hidden(container_play_scr_uiflowplay, true); + // lv_obj_set_hidden(container_play_scr_uiflowplay, true); return; } //show icon From 488c4c1e34598012fb4b7ce51d1cdccac77f787a Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Tue, 19 Dec 2023 14:52:25 +0800 Subject: [PATCH 03/11] Fixed bug number 10204. --- .../UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c | 2 +- .../UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 95734847e..823315129 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 @@ -1398,7 +1398,7 @@ static void UIFlowPhoto_ScrOpen(lv_obj_t* obj) /* never closed */ gPhotoData.State = PHOTO_ST_WARNING_MENU; - UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, 1000); + // UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, 1000); // UIFlowMenuCommonConfirmAPI_Open(IDM_FORMAT); // return; #endif 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 1503713f0..5d183fd8c 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 @@ -110,6 +110,11 @@ static void UIFlowPlay_IconImageSize(BOOL bShow) } else { OriImgHeight = (UINT32)hd_vdoframe_info.dim.h; } + if (uiFileFmt & (PBFMT_MOVMJPG | PBFMT_AVI | PBFMT_MP4 | PBFMT_TS)) { + lv_obj_set_hidden(container_play_scr_uiflowplay, false); + } else { + lv_obj_set_hidden(container_play_scr_uiflowplay, true); + } //hide icon if (bShow == FALSE) { @@ -988,6 +993,7 @@ static void UIFlowPlay_ScrOpen(lv_obj_t* obj) update_playicons(g_PlbData.State); // Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PHOTO); UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_NO_FILE, 3000); + lv_obj_set_hidden(container_play_scr_uiflowplay, true); return; } From 9741bf7716d236a63966c0d99abf810f8e5468f4 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Wed, 20 Dec 2023 10:17:03 +0800 Subject: [PATCH 04/11] Fixed bug:show review screen when power off. --- .../source/cardv/SrcCode/System/SysMain_Exe.c | 24 +++++++++++++++---- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 4 ++++ .../sifar/code/source/common/sf_common.c | 1 - 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/code/application/source/cardv/SrcCode/System/SysMain_Exe.c b/code/application/source/cardv/SrcCode/System/SysMain_Exe.c index a479a460c..aa392aacc 100755 --- a/code/application/source/cardv/SrcCode/System/SysMain_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysMain_Exe.c @@ -422,6 +422,7 @@ BOOL System_GetShutdownBegin(void) INT32 System_OnShutdown(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { UINT32 displayShow = SHOW_POWER_OFF; + BOOL isMenu = sf_is_menu_open(); if ( paramNum >= 2) { DBG_DUMP("^MOn Shutdown begin paramNum:%d paramArray[0]:%d paramArray[1]:%d\r\n",paramNum, paramArray[0], paramArray[1]); @@ -479,11 +480,24 @@ INT32 System_OnShutdown(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) if(sf_get_mode_flag() && SHOW_POWER_OFF == displayShow) #endif { - GxDisplay_Set(LAYER_OSD1, LAYER_STATE_ENABLE, 0); //turn off OSD1 - GxDisplay_Flush(LAYER_OSD1); - - Display_ShowSplash(SPLASH_POWEROFF); - SwTimer_DelayMs(500); + if (FALSE == isMenu) + { + GxDisplay_Set(LAYER_OSD1, LAYER_STATE_ENABLE, 0); //turn off OSD1 + GxDisplay_Flush(LAYER_OSD1); + Display_ShowSplash(SPLASH_POWEROFF); + SwTimer_DelayMs(500); + } + else + { + Display_ShowSplash(SPLASH_POWEROFF); + SwTimer_DelayMs(500); + GxDisplay_Set(LAYER_OSD1, LAYER_STATE_ENABLE, 0); //turn off OSD1 + GxDisplay_Flush(LAYER_OSD1); + } + // Display_ShowSplash(SPLASH_POWEROFF); + // SwTimer_DelayMs(500); + // GxDisplay_Set(LAYER_OSD1, LAYER_STATE_ENABLE, 0); //turn off OSD1 + // GxDisplay_Flush(LAYER_OSD1); } #endif } 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 823315129..eb3c68ce3 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 @@ -1383,6 +1383,8 @@ void UIFlowPhoto_OnBatteryLow(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* ms static void UIFlowPhoto_ScrOpen(lv_obj_t* obj) { + lv_obj_set_hidden(container_photo_scr_uiflowphoto, false); + lv_obj_set_hidden(label_line_scr_uiflowphoto, false); set_indev_keypad_group(obj); update_fd_frame(); //#NT#2016/10/04#Lincy Lin -begin @@ -1489,6 +1491,8 @@ static void UIFlowPhoto_ScrClose(lv_obj_t* obj) /* Reset key press/release/continue mask to default */ Ux_FlushEventByRange(NVTEVT_KEY_EVT_START, NVTEVT_KEY_EVT_END); + lv_obj_set_hidden(container_photo_scr_uiflowphoto, true); + lv_obj_set_hidden(label_line_scr_uiflowphoto, true); return; } 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 7d8f1a314..b8eb1eaa9 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -2018,7 +2018,6 @@ void sf_cardv_message_thread_init(void) void sf_set_menu_open(BOOL is) { IsMenu = is; - //printf("[%s]:%d IsMenu:%d\n", __FUNCTION__, __LINE__, IsMenu); } BOOL sf_is_menu_open(void) From 27f5c29b3371f0719810ed92f41c3277a941e858 Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 20 Dec 2023 15:53:57 +0800 Subject: [PATCH 05/11] =?UTF-8?q?1.=E5=B1=8F=E8=94=BDrtos=20log=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=EF=BC=8Cds05=E6=B5=8B=E8=AF=95=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=86=85=E5=AD=98=E4=B8=8D=E8=B6=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/source/cardv/SrcCode/System/sys_filesys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtos/code/application/source/cardv/SrcCode/System/sys_filesys.c b/rtos/code/application/source/cardv/SrcCode/System/sys_filesys.c index 468644420..4c0a02ec5 100755 --- a/rtos/code/application/source/cardv/SrcCode/System/sys_filesys.c +++ b/rtos/code/application/source/cardv/SrcCode/System/sys_filesys.c @@ -70,8 +70,8 @@ static void card_insert_job(void) else { fastboot_set_done(BOOT_INIT_FILESYSOK); - sf_log_confg(); - sf_log_open(); + // sf_log_confg(); + // sf_log_open(); } #endif From e8f2ea7d8ffa28cde75299c60952b5a0c8b6ff80 Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 20 Dec 2023 16:25:17 +0800 Subject: [PATCH 06/11] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=9B=9E=E6=94=B6mem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/cardv/Makefile | 1 + .../source/cardv/SrcCode/System/main.c | 4 + .../source/cardv/SrcCode/System/mem_hotplug.c | 82 +++++++++++++++++++ .../source/cardv/SrcCode/System/mem_hotplug.h | 7 ++ .../nvt-mem-tbl.dtsi | 2 +- 5 files changed, 95 insertions(+), 1 deletion(-) create mode 100755 code/application/source/cardv/SrcCode/System/mem_hotplug.c create mode 100755 code/application/source/cardv/SrcCode/System/mem_hotplug.h diff --git a/code/application/source/cardv/Makefile b/code/application/source/cardv/Makefile index 91affbc5a..b7ad8541b 100755 --- a/code/application/source/cardv/Makefile +++ b/code/application/source/cardv/Makefile @@ -122,6 +122,7 @@ SRC = \ ./SrcCode/System/SysFW_Upgrade_Strg_Obj.c \ ./SrcCode/System/SysFW_Upgrade.c \ ./SrcCode/System/sys_usrmem.c \ + ./SrcCode/System/mem_hotplug.c \ ./SrcCode/UIApp/UIAppObj.c \ ./SrcCode/UIApp/ExifVendor.c \ ./SrcCode/UIApp/Setup/UISetup_Exe.c \ diff --git a/code/application/source/cardv/SrcCode/System/main.c b/code/application/source/cardv/SrcCode/System/main.c index 60e735c39..3af208301 100755 --- a/code/application/source/cardv/SrcCode/System/main.c +++ b/code/application/source/cardv/SrcCode/System/main.c @@ -14,6 +14,7 @@ #include "comm/timer.h" #include #include +#include "mem_hotplug.h" #if HUNTING_CAMERA_MCU == ENABLE #include #include "sf_log.h" @@ -250,6 +251,9 @@ UINT32 nvt_hdal_init(void) DBG_ERR("mem init fail=%d\n", ret); return -1; } + + memory_hotplug(); + ret = hd_gfx_init(); if(ret != HD_OK) { DBG_ERR("gfx init fail=%d\n", ret); diff --git a/code/application/source/cardv/SrcCode/System/mem_hotplug.c b/code/application/source/cardv/SrcCode/System/mem_hotplug.c new file mode 100755 index 000000000..90fc2a0c5 --- /dev/null +++ b/code/application/source/cardv/SrcCode/System/mem_hotplug.c @@ -0,0 +1,82 @@ +#include +#include +#include "mem_hotplug.h" +#include "kwrap/debug.h" + +#define SWAP4(x) ((((x) & 0xFF) << 24) | (((x) & 0xFF00) << 8) | (((x) & 0xFF0000) >> 8) | (((x) & 0xFF000000) >> 24)) + +static int read_fdt(const char *path, unsigned int *p_addr, unsigned int *p_size) +{ + int fd; + unsigned int reg[2] = {0}; + + if ((fd = open(path, O_RDONLY)) < 0) { + printf("unable to open %s\n", path); + return -1; + } + + if (read(fd, reg, sizeof(reg)) != sizeof(reg)) { + printf("unable to read reg on %s\n", path); + close(fd); + return -1; + } + + *p_addr = SWAP4(reg[0]); + *p_size = SWAP4(reg[1]); + close(fd); + return 0; +} + +static int get_mem_range(unsigned int *p_addr, unsigned int *p_size) +{ + unsigned int fdt_addr, fdt_size; + unsigned int rtos_addr, rtos_size; +// unsigned int bridge_addr, bridge_size; + //get fdt addr and size in nvt_memory_cfg + if (read_fdt("/sys/firmware/devicetree/base/nvt_memory_cfg/fdt/reg", &fdt_addr, &fdt_size) != 0) { + return -1; + } + if (read_fdt("/sys/firmware/devicetree/base/nvt_memory_cfg/rtos/reg", &rtos_addr, &rtos_size) != 0) { + return -1; + } + +#if 0 /* bridge is not used */ + if (read_fdt("/sys/firmware/devicetree/base/nvt_memory_cfg/bridge/reg", &bridge_addr, &bridge_size) != 0) { + return -1; + } +#endif + + *p_addr = fdt_addr; + *p_size = fdt_size + rtos_size; +// *p_size = fdt_size + rtos_size + bridge_size; + return 0; +} + +static int do_hotplug(unsigned int mem_begin, unsigned mem_size) +{ + HD_RESULT ret=0; + VENDOR_LINUX_MEM_HOT_PLUG desc = {0}; + desc.start_addr = mem_begin; + desc.size = mem_size; + ret = vendor_common_mem_set(VENDOR_COMMON_MEM_ITEM_LINUX_HOT_PLUG, &desc); + if(ret != 0){ + printf("nvtmem_hotplug_set fail ret:%d\n", (int)ret); + } + return 0; +} + +HD_RESULT memory_hotplug(void) +{ + unsigned int mem_begin, mem_size; + + // read memory space from bridge memory + if (get_mem_range(&mem_begin, &mem_size) != 0) { + return HD_ERR_INIT; + } + // do hotplug + if (do_hotplug(mem_begin, mem_size) != 0) { + return HD_ERR_SYS; + } + + return 0; +} diff --git a/code/application/source/cardv/SrcCode/System/mem_hotplug.h b/code/application/source/cardv/SrcCode/System/mem_hotplug.h new file mode 100755 index 000000000..71a2f281c --- /dev/null +++ b/code/application/source/cardv/SrcCode/System/mem_hotplug.h @@ -0,0 +1,7 @@ +#ifndef _MEM_HOTPLUG_H +#define _MEM_HOTPLUG_H +#include + +extern HD_RESULT memory_hotplug(void); + +#endif \ No newline at end of file diff --git a/configs/Linux/cfg_565_HUNTING_EVB_LINUX_4G_S550/nvt-mem-tbl.dtsi b/configs/Linux/cfg_565_HUNTING_EVB_LINUX_4G_S550/nvt-mem-tbl.dtsi index ea25fb642..d87aa1741 100755 --- a/configs/Linux/cfg_565_HUNTING_EVB_LINUX_4G_S550/nvt-mem-tbl.dtsi +++ b/configs/Linux/cfg_565_HUNTING_EVB_LINUX_4G_S550/nvt-mem-tbl.dtsi @@ -21,7 +21,7 @@ }; /* Linux system memory region*/ - memory { device_type = "memory"; reg = <0x00000000 0x01800000 0x02000000 0x01600000>; }; + memory { device_type = "memory"; reg = <0x00000000 0x01800000 0x02800000 0x00E00000>; }; /* Linux setup reserved memory */ reserved-memory { From cc78dae655a5c68d064b67a07bdc9da17c3f3914 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Wed, 20 Dec 2023 16:29:46 +0800 Subject: [PATCH 07/11] Improve:Can not show delete comfirm screen when no file. --- .../UIFlowPlay/UIFlowPlayEventCallback.c | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 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 5d183fd8c..d1b0a01c1 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 @@ -2023,16 +2023,26 @@ static void UIFlowPlay_Key(lv_obj_t* obj, uint32_t key) break; } case LV_USER_KEY_LEFT: + { + UINT32 uiFileSeq; + PB_GetParam(PBPRMID_CURR_FILESEQ, &uiFileSeq); + if (0 != uiFileSeq) { stop_play(); UIFlowPlay_OnKeyUp(obj); - break; + } + break; } case LV_USER_KEY_RIGHT: + { + UINT32 uiFileSeq; + PB_GetParam(PBPRMID_CURR_FILESEQ, &uiFileSeq); + if (0 != uiFileSeq) { stop_play(); UIFlowPlay_OnKeyDown(obj); - break; + } + break; } case LV_USER_KEY_UP: @@ -2045,13 +2055,18 @@ static void UIFlowPlay_Key(lv_obj_t* obj, uint32_t key) case LV_USER_KEY_DOWN: case LV_USER_KEY_NEXT: { + UINT32 uiFileSeq; + PB_GetParam(PBPRMID_CURR_FILESEQ, &uiFileSeq); + if (0 != uiFileSeq) + { stop_play(); UIFlowMenuCommonConfirmAPI_Open(IDM_DELETE_THIS); break; UIFlowPlay_OnKeyNext(obj); break; } - + break; + } case LV_USER_KEY_ZOOMIN: { break; From 7e4f40ccc0d6da7dad7af41976d48170bf5800c0 Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 20 Dec 2023 16:48:51 +0800 Subject: [PATCH 08/11] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=8E=B7=E5=8F=96=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/source/sf_app/code/source/4gMng/sf_eg91_sim.c | 4 ++-- .../source/sf_app/code/source/systemMng/sf_commu_mcu.c | 2 +- .../source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c index 3acbd8a7a..9e5a8259b 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c @@ -3992,7 +3992,7 @@ SINT32 sf_net_regist_manual(void) } } - if((sf_get_mode_flag()) || (PWR_ON_GPRS_INIT == sf_convert_power_on_mode()) || (PWR_ON_DAILY_REPORT == sf_convert_power_on_mode())) + if((sf_get_mode_flag()) || (PWR_ON_GPRS_INIT == sf_poweron_type_get()) || (PWR_ON_DAILY_REPORT == sf_poweron_type_get())) { eNetRegLocation = QUECTEL_NETREG_ATW; strcpy((char *)gsmPara, "AT&W\r"); @@ -4142,7 +4142,7 @@ SINT32 sf_auto_net_reg(void) } else if(strstr((const char *)gsmPara, "+QSIMSTAT: 0,1")) { - if(PWR_ON_SMS == sf_convert_power_on_mode()) + if(PWR_ON_SMS == sf_poweron_type_get()) { eNetRegLocation = QUECTEL_NETREG_CGREG; strcpy((char *)gsmPara, "AT+CGREG?\r"); diff --git a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu.c b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu.c index 151de0b01..a00fb902b 100755 --- a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu.c +++ b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu.c @@ -964,7 +964,7 @@ unsigned char sf_commu_parse_mcu_data(unsigned char * src, unsigned int len) { sf_set_pir_statu_flag(0); sf_set_module_sleep_flag(0); - if((PWR_ON_SETUP != sf_convert_power_on_mode()) && (PWR_ON_USB!= sf_convert_power_on_mode())) + if((PWR_ON_SETUP != sf_poweron_type_get()) && (PWR_ON_USB!= sf_poweron_type_get())) { printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__); sf_set_power_off_flag(1); diff --git a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c index 7834cd807..2a37a9032 100755 --- a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c +++ b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c @@ -1157,7 +1157,7 @@ UINT8 sf_get_power_on_mode(void) } return ModeFlag; } -UINT8 sf_convert_power_on_mode(void) +UINT8 sf_convert_power_on_mode(void)//sf_poweron_type_get { //PowerOnMode &= 0x0f; //printf("[%s:%d]PowerOnMode=0x%x\n",__FUNCTION__,__LINE__,PowerOnMode); From dd14b586b3829bb686fd2217b98770410a52494d Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 20 Dec 2023 19:24:21 +0800 Subject: [PATCH 09/11] =?UTF-8?q?1.rtos=E4=B8=8Bemmc=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- .../source/cardv/SrcCode/System/SysStrg_Exe.c | 24 +++--- .../source/cardv/SrcCode/System/sys_card.c | 10 +++ .../source/cardv/SrcCode/System/sys_filesys.c | 77 +++++++++++++++-- .../source/cardv/SrcCode/System/sys_mempool.c | 14 ++++ .../cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c | 84 ++++++++++++++++++- .../SrcCode/UIApp/UsbDisk/UIAppUsbDisk_Exe.c | 34 ++++---- 7 files changed, 209 insertions(+), 36 deletions(-) diff --git a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index 058fb0aad..f6263c633 100755 --- a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -849,7 +849,7 @@ // 2. enable FS_DX_TYPE_DRIVE_B as DX_TYPE_CARD2 // 3. enable FS_MULTI_STRG_FUNC // 4. NETWORK = NETWORK_NONE (Both uITRON and eCos) -#define FS_MULTI_STRG_FUNC DISABLE +#define FS_MULTI_STRG_FUNC ENABLE //MULTI_DRIVE #if defined(_EMBMEM_EMMC_) && (FS_MULTI_STRG_FUNC==DISABLE) #define FS_DX_TYPE_DRIVE_A USER_DX_TYPE_EMBMEM_FAT diff --git a/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index fdb3192a5..4c9c38ecc 100644 --- a/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -299,16 +299,16 @@ void System_OnStrgInit_FS(void) Pool.addr = mempool_filesys; #if (FS_MULTI_STRG_FUNC == ENABLE) MEM_RANGE Pool2; - Pool.Size = POOL_SIZE_FS_BUFFER; + Pool.size = POOL_SIZE_FILESYS; GxStrg_SetConfigEx(0, FILE_CFG_BUF, (UINT32)&Pool); - Pool2.Addr = Pool.Addr + POOL_SIZE_FS_BUFFER; - Pool2.Size = POOL_SIZE_FS_BUFFER; + Pool2.addr = Pool.addr + POOL_SIZE_FILESYS; + Pool2.size = POOL_SIZE_FILESYS; GxStrg_SetConfigEx(1, FILE_CFG_BUF, (UINT32)&Pool2); #if defined(_CPU2_LINUX_) && defined(_EMBMEM_EMMC_) // 3rd is for linux-pstore mounted by filesys MEM_RANGE Pool3; - Pool3.Addr = Pool2.Addr + POOL_SIZE_FS_BUFFER; - Pool3.Size = POOL_SIZE_FS_BUFFER; + Pool3.Addr = Pool2.addr + POOL_SIZE_FS_BUFFER; + Pool3.size = POOL_SIZE_FS_BUFFER; GxStrg_SetConfigEx(PST_DEV_ID, FILE_CFG_BUF, (UINT32)&Pool3); #endif #else @@ -592,22 +592,24 @@ INT32 System_OnStrgInsert(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) // Open DCF dcfParm.Drive = (stg_id == 0) ? 'A' : 'B'; #if (FS_MULTI_STRG_FUNC) - if (POOL_CNT_DCF_BUFFER !=2) { - DBG_FATAL("POOL_CNT_DCF_BUFFER be 2 for FS_MULTI_STRG_FUNC.\r\n"); - } else { +// if (POOL_CNT_DCF_BUFFER !=2) { +// DBG_FATAL("POOL_CNT_DCF_BUFFER be 2 for FS_MULTI_STRG_FUNC.\r\n"); +// } else { switch(stg_id) { case 0: - dcfParm.WorkbuffAddr = dma_getCacheAddr(OS_GetMempoolAddr(POOL_ID_DCF_BUFFER)); +// dcfParm.WorkbuffAddr = dma_getCacheAddr(OS_GetMempoolAddr(POOL_ID_DCF_BUFFER)); + dcfParm.WorkbuffAddr = mempool_dcf; break; case 1: - dcfParm.WorkbuffAddr = dma_getCacheAddr(OS_GetMempoolAddr(POOL_ID_DCF_BUFFER)) + POOL_SIZE_DCF_BUFFER; +// dcfParm.WorkbuffAddr = dma_getCacheAddr(OS_GetMempoolAddr(POOL_ID_DCF_BUFFER)) + POOL_SIZE_DCF_BUFFER; + dcfParm.WorkbuffAddr = mempool_dcf + POOL_SIZE_DCF_BUFFER; break; default: DBG_ERR("unknown stg_id=%d\r\n", stg_id); dcfParm.WorkbuffAddr = 0; break; } - } +// } #else dcfParm.WorkbuffAddr = mempool_dcf;//dma_getCacheAddr(OS_GetMempoolAddr(POOL_ID_DCF_BUFFER)); diff --git a/rtos/code/application/source/cardv/SrcCode/System/sys_card.c b/rtos/code/application/source/cardv/SrcCode/System/sys_card.c index 5b1916428..091850bc3 100755 --- a/rtos/code/application/source/cardv/SrcCode/System/sys_card.c +++ b/rtos/code/application/source/cardv/SrcCode/System/sys_card.c @@ -25,5 +25,15 @@ void card_init(void) sdio_setCallBack(SDIO_CALLBACK_CARD_DETECT, (SDIO_CALLBACK_HDL)card_det_insert); sdio_setCallBack(SDIO_CALLBACK_WRITE_PROTECT, (SDIO_CALLBACK_HDL)card_det_wp); pStrg->SetParam(STRG_SET_MEMORY_REGION, mempool_storage_sdio, POOL_SIZE_STORAGE_SDIO); + +#if FS_MULTI_STRG_FUNC + pStrg = sdio2_getStorageObject(STRG_OBJ_FAT1); + sdio2_setCallBack(SDIO_CALLBACK_CARD_DETECT, (SDIO_CALLBACK_HDL)card_det_insert); + sdio2_setCallBack(SDIO_CALLBACK_WRITE_PROTECT, (SDIO_CALLBACK_HDL)card_det_wp); + pStrg->SetParam(STRG_SET_MEMORY_REGION, mempool_storage_sdio + POOL_SIZE_STORAGE_SDIO, POOL_SIZE_STORAGE_SDIO); +#endif + + + #endif } diff --git a/rtos/code/application/source/cardv/SrcCode/System/sys_filesys.c b/rtos/code/application/source/cardv/SrcCode/System/sys_filesys.c index 4c0a02ec5..ae1dc14be 100755 --- a/rtos/code/application/source/cardv/SrcCode/System/sys_filesys.c +++ b/rtos/code/application/source/cardv/SrcCode/System/sys_filesys.c @@ -12,6 +12,7 @@ #include "sys_fastboot.h" #include "PrjCfg.h" #include "DxHunting.h" +#include #if HUNTING_CAMERA_MCU == ENABLE #include "PrjInc.h" #include "wdt.h" @@ -32,7 +33,7 @@ static void card_insert_job(void) int ret; FILE_TSK_INIT_PARAM Param = {0}; - FS_HANDLE StrgDXH; + FS_HANDLE StrgDXH, StrgDXH2; printf("filesys_init b\r\n"); memset(&Param, 0, sizeof(FILE_TSK_INIT_PARAM)); @@ -42,6 +43,49 @@ static void card_insert_job(void) StrgDXH = (FS_HANDLE)sdio_getStorageObject(STRG_OBJ_FAT1); #endif +#if FS_MULTI_STRG_FUNC + StrgDXH2 = (FS_HANDLE)sdio2_getStorageObject(STRG_OBJ_FAT1); + + + DBG_WRN("sdio2_getStorageObject\n"); + { + UINT32 totoal_sectors = 0; +// UINT32 uiPhyAddr = 0; +// UINT32 uiPhySize = 0; +// unsigned long long partition_ofs= 0, partition_size = 0; +// unsigned long long usr_area_size = 0; + STORAGE_OBJ* pStrg = sdio2_getStorageObject(STRG_OBJ_FAT1); +// void *strg_mem = malloc(0x300); + +// pStrg->SetParam(STRG_SET_MEMORY_REGION, (UINT32)strg_mem, 0x300); + pStrg->Open(); //for initial emmc speed up, should open first, and then set partition + pStrg->GetParam(STRG_GET_DEVICE_PHY_SECTORS, (UINT32)&totoal_sectors, 0); + if (totoal_sectors == 0) { + DBG_WRN("totoal_sectors couldn't be zero\n"); + } + + DBG_WRN("storage_partition_init: totoal_sectors = %d\r\n", totoal_sectors); + pStrg->SetParam(STRG_SET_PARTITION_SECTORS, 16, totoal_sectors - 16); +// pStrg->Close(); + + //set the FAT size +// ret = storage_get_partition_addr(&partition_ofs, &partition_size, PARTITION_PATH_ROOTFSL1); +// usr_area_size = (unsigned long long)totoal_sectors*(unsigned long long)_EMBMEM_BLK_SIZE_; +// uiPhyAddr = partition_ofs/_EMBMEM_BLK_SIZE_; +// uiPhySize = (usr_area_size - partition_ofs)/_EMBMEM_BLK_SIZE_; +// if (ret == 0) { +// pStrg = EMB_GETSTRGOBJ(STRG_OBJ_FW_FAT); +// pStrg->SetParam(STRG_SET_MEMORY_REGION, (UINT32)strg_mem, STRG_MEM_SIZE); +// pStrg->SetParam(STRG_SET_PARTITION_SECTORS, uiPhyAddr, uiPhySize); +// } else { +// DBG_ERR("Cat get the %s path info\r\n", PARTITION_PATH_ROOTFSL1); +// } + } + + +#endif + + uiPoolAddr = mempool_filesys; Param.FSParam.WorkBuf = uiPoolAddr; Param.FSParam.WorkBufSize = (POOL_SIZE_FILESYS); @@ -52,11 +96,11 @@ static void card_insert_job(void) Param.FSParam.szMountPath[sizeof(Param.FSParam.szMountPath) - 1] = '\0'; Param.FSParam.MaxOpenedFileNum = MAX_OPENED_FILE_NUM; if (FST_STA_OK != FileSys_Init(FileSys_GetOPS_uITRON())) { - printf("FileSys_Init failed\r\n"); + DBG_WRN("FileSys_Init failed\r\n"); } ret = FileSys_OpenEx('A', StrgDXH, &Param); if (FST_STA_OK != ret) { - printf("FileSys_Open err %d\r\n", ret); + DBG_WRN("FileSys_Open err %d\r\n", ret); } // call the function to wait init finish FileSys_WaitFinishEx('A'); @@ -64,7 +108,7 @@ static void card_insert_job(void) #if HUNTING_CAMERA_MCU == ENABLE if(TRUE == sf_check_card_full()) { - printf("ERR card full\r\n"); + DBG_WRN("ERR card full\r\n"); fastboot_set_done(BOOT_INIT_FILESYSOK); } else @@ -75,8 +119,31 @@ static void card_insert_job(void) } #endif +#if FS_MULTI_STRG_FUNC + uiPoolAddr = mempool_filesys + POOL_SIZE_FILESYS; + Param.FSParam.WorkBuf = uiPoolAddr; + Param.FSParam.WorkBufSize = (POOL_SIZE_FILESYS); + // support exFAT + Param.FSParam.bSupportExFAT = FALSE; + //Param.pDiskErrCB = (FileSys_CB)Card_InitCB; + strncpy(Param.FSParam.szMountPath, "/mnt/sd2", sizeof(Param.FSParam.szMountPath) - 1); //only used by FsLinux + Param.FSParam.szMountPath[sizeof(Param.FSParam.szMountPath) - 1] = '\0'; + Param.FSParam.MaxOpenedFileNum = MAX_OPENED_FILE_NUM; +// if (FST_STA_OK != FileSys_Init(FileSys_GetOPS_uITRON())) { +// printf("FileSys_Init failed\r\n"); +// } + DBG_WRN("Open B:\n"); + ret = FileSys_OpenEx('B', StrgDXH2, &Param); + if (FST_STA_OK != ret) { + printf("FileSys_Open err %d\r\n", ret); + } + // call the function to wait init finish + FileSys_WaitFinishEx('B'); +// FileSys_SetParamEx('B', FST_PARM_UPDATE_FSINFO , TRUE); +#endif + //fastboot_set_done(BOOT_INIT_FILESYSOK); - printf("filesys_init e\r\n"); + DBG_WRN("filesys_init e\r\n"); } #if !defined(_EMBMEM_EMMC_) diff --git a/rtos/code/application/source/cardv/SrcCode/System/sys_mempool.c b/rtos/code/application/source/cardv/SrcCode/System/sys_mempool.c index 19a1dd32c..7df0f47de 100755 --- a/rtos/code/application/source/cardv/SrcCode/System/sys_mempool.c +++ b/rtos/code/application/source/cardv/SrcCode/System/sys_mempool.c @@ -60,7 +60,11 @@ void mempool_init(void) UINT32 pa; HD_RESULT ret; +#if FS_MULTI_STRG_FUNC + ret = vendor_common_mem_alloc_fixed_pool("sdio", &pa, (void **)&va, POOL_SIZE_STORAGE_SDIO * 2, DDR_ID0); +#else ret = vendor_common_mem_alloc_fixed_pool("sdio", &pa, (void **)&va, POOL_SIZE_STORAGE_SDIO, DDR_ID0); +#endif if (ret != HD_OK) { return; } @@ -77,7 +81,11 @@ void mempool_init(void) } mempool_storage_nor = (UINT32)va; +#if FS_MULTI_STRG_FUNC + ret = vendor_common_mem_alloc_fixed_pool("filesys", &pa, (void **)&va, POOL_SIZE_FILESYS * 2, DDR_ID0); +#else ret = vendor_common_mem_alloc_fixed_pool("filesys", &pa, (void **)&va, POOL_SIZE_FILESYS, DDR_ID0); +#endif if (ret != HD_OK) { return; } @@ -215,11 +223,17 @@ void mempool_init(void) mempool_usbcmd_va = (UINT32)va; #endif #if (HUNTING_CAMERA_MODEL == ENABLE) + +#if (FS_MULTI_STRG_FUNC) + ret = vendor_common_mem_alloc_fixed_pool("dcf", &pa, (void **)&va, POOL_SIZE_DCF_BUFFER * 2, DDR_ID0); +#else ret = vendor_common_mem_alloc_fixed_pool("dcf", &pa, (void **)&va, POOL_SIZE_DCF_BUFFER, DDR_ID0); +#endif if (ret != HD_OK) { return; } mempool_dcf = (UINT32)va; + #endif } diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c index b056c5eb9..4b9102435 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c @@ -88,6 +88,7 @@ static CHAR g_photo_fast_write_file_Path[NMC_TOTALFILEPATH_MAX_LE static INT32 g_photo_fast_id_mapping[PHOTO_CAP_ID_MAX] = {-1,-1}; static PHOTO_FILENAME_CB *g_fpPhotoFastFileNameCB = NULL; static DCF_HANDLE g_dcf_hdl = 0; +static DCF_HANDLE g_dcf_hdl2 = 0; static HD_PATH_ID g_video_enc_path[PHOTO_ENC_JPG_TYPE_MAX_ID] = {0}; static UINT32 g_bVideoEncPathStart[PHOTO_ENC_JPG_TYPE_MAX_ID] = {0}; static HD_VIDEOENC_BUFINFO g_enc_buf_info[PHOTO_ENC_JPG_TYPE_MAX_ID] = {0}; @@ -722,6 +723,31 @@ INT32 PhotoFast_FileNaming_Open(void) DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); DCF_ScanObj(); +#if (FS_MULTI_STRG_FUNC) + { + DCF_OPEN_PARM dcfParm = { + .Drive = 'B', + .WorkbuffAddr = mempool_dcf + POOL_SIZE_DCF_BUFFER, + .WorkbuffSize = POOL_SIZE_DCF_BUFFER, + }; + g_dcf_hdl2 = DCF_Open(&dcfParm); + if(g_dcf_hdl2 < 0){ + DBG_ERR("get dcf handle error!\n"); + } + + + DBG_WRN("DCF_ScanObjEx emmc handle=%d\n", g_dcf_hdl2); +// DCF_SetParm(DCF_PRMID_REMOVE_DUPLICATE_FOLDER, TRUE); +// DCF_SetParm(DCF_PRMID_REMOVE_DUPLICATE_FILE, TRUE); +// DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV); +// DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO); +// DCF_SetDirFreeChars(DCF_DIR_NAME); +// DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); + DCF_ScanObjEx(g_dcf_hdl2); + } +#endif + + return 0; } @@ -734,6 +760,11 @@ INT32 PhotoFast_FileNaming_Close(void) g_dcf_hdl = -1; } +#if (FS_MULTI_STRG_FUNC) + DCF_Close(g_dcf_hdl2); + g_dcf_hdl2 = -1; +#endif + DCF_UnInstallID(); } @@ -856,6 +887,11 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, INT32 rt; UINT32 Length; CHAR FilePath[NMC_TOTALFILEPATH_MAX_LEN]; + +#if FS_MULTI_STRG_FUNC + CHAR FilePath2[NMC_TOTALFILEPATH_MAX_LEN]; +#endif + UINT32 fileType; UINT32 open_flag; UINT32 nextFolderID = 0, nextFileID = 0; @@ -898,9 +934,30 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, } } DCF_MakeObjPath(nextFolderID, nextFileID, fileType, FilePath); - DCF_AddDBfile(FilePath); - DBG_DUMP("%s added to DCF\r\n", FilePath); + DCF_AddDBfile(FilePath); + DBG_DUMP("%s added to DCF\r\n", FilePath); } + +#if 0//FS_MULTI_STRG_FUNC + + if (DCF_GetDBInfoEx(g_dcf_hdl2, DCF_INFO_IS_9999)) { + DBG_ERR("Exceed max dcf file!\r\n"); + return FST_STA_NOFREE_SPACE; + } + else { + if (Fmt == HD_CODEC_TYPE_RAW){ + fileType = DCF_FILE_TYPE_RAW; + } + else{ + fileType = DCF_FILE_TYPE_JPG; + } + //DCF_GetNextIDEx(g_dcf_hdl2, &nextFolderID,&nextFileID); + DCF_MakeObjPathEx(g_dcf_hdl2, nextFolderID, nextFileID, fileType, FilePath2); + DCF_AddDBfileEx(g_dcf_hdl2, FilePath2); + DBG_DUMP("%s added to DCF2\r\n", FilePath2); + } +#endif + } else{ strncpy(FilePath, Path, sizeof(FilePath)); @@ -948,6 +1005,29 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, rt =FST_STA_ERROR; } +#if FS_MULTI_STRG_FUNC + + DBG_WRN("write %s\n", FilePath2); + if ((fp = FileSys_OpenFile(FilePath2, open_flag)) != NULL) { + Length = Size; + + rt = FileSys_WriteFile(fp, (UINT8 *)Addr, &Length, 0, NULL); + FileSys_FlushFile(fp); + FileSys_CloseFile(fp); + if (rt == FST_STA_OK) { + // DCF_AddDBfile(FilePath); + // DBG_DUMP("%s added to DCF\r\n", FilePath); + } else { + DBG_ERR("Addr=0x%x,Size=0x%x,Fmt=%d\r\n", Addr, Size, Fmt); + } + }else{ + DBG_ERR("FileSys_OpenFile fail\r\n"); + rt =FST_STA_ERROR; + } + +#endif + + return rt; } diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/UsbDisk/UIAppUsbDisk_Exe.c b/rtos/code/application/source/cardv/SrcCode/UIApp/UsbDisk/UIAppUsbDisk_Exe.c index b8151059a..a6e618cb0 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/UsbDisk/UIAppUsbDisk_Exe.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/UsbDisk/UIAppUsbDisk_Exe.c @@ -153,10 +153,10 @@ ER AppInit_ModeUSBMSDC(void) MSDCInfo.msdc_vendor_cb = NULL; //#NT#2016/12/20#Niven Cho -begin //#NT#MULTI_DRIVE -#if (FS_MULTI_STRG_FUNC == ENABLE) - char *pDxName2 = NULL; - DX_HANDLE pStrgDev2 = 0; -#endif +// #if (FS_MULTI_STRG_FUNC == ENABLE) +// char *pDxName2 = NULL; +// DX_HANDLE pStrgDev2 = 0; +// #endif pStrgDev = Dx_GetObject(DX_CLASS_STORAGE_EXT | FS_DX_TYPE_DRIVE_A); @@ -178,21 +178,21 @@ ER AppInit_ModeUSBMSDC(void) } DBG_DUMP("===>%s\r\n", pDxName); -#if (FS_MULTI_STRG_FUNC == ENABLE) - MSDCInfo.pStrgHandle[1] = pStrgDev2; +// #if (FS_MULTI_STRG_FUNC == ENABLE) +// MSDCInfo.pStrgHandle[1] = pStrgDev2; - if (Dx_GetInfo(pStrgDev2, DX_INFO_NAME, &pDxName2) != DX_OK) { - pDxName2 = NULL; - } -#endif +// if (Dx_GetInfo(pStrgDev2, DX_INFO_NAME, &pDxName2) != DX_OK) { +// pDxName2 = NULL; +// } +// #endif -#if (FS_MULTI_STRG_FUNC == ENABLE) - MSDCInfo.pStrgHandle[1] = pStrgDev2; +// #if (FS_MULTI_STRG_FUNC == ENABLE) +// MSDCInfo.pStrgHandle[1] = pStrgDev2; - if (Dx_GetInfo(pStrgDev2, DX_INFO_NAME, &pDxName2) != DX_OK) { - pDxName2 = NULL; - } -#endif +// if (Dx_GetInfo(pStrgDev2, DX_INFO_NAME, &pDxName2) != DX_OK) { +// pDxName2 = NULL; +// } +// #endif #if (FS_MULTI_STRG_FUNC == ENABLE) MSDCInfo.msdc_storage_detCB[0] = (MSDC_StorageDet_CB)DrvCARD_DetStrgCard; @@ -280,7 +280,7 @@ INT32 MSDCExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) pLastStrgDev = GxStrg_GetDevice(0); if (pLastStrgDev == 0) { - //PowerOn_CB() POWERON_CB_SXOPEN ¨S¦³´£¦­±Ò°ÊFile System + //PowerOn_CB() POWERON_CB_SXOPEN �S�������Ұ�File System DBG_ERR("MSDC: Wait for FS start...\r\n"); FileSys_WaitFinish(); From 4949561ac1dc4b4a991079b11d986882e4c9718d Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 20 Dec 2023 19:35:08 +0800 Subject: [PATCH 10/11] 1.ver:7MR5RCwDC05 --- code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- .../code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index 4b869ab2c..4812f681f 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -922,7 +922,7 @@ #define HUNTING_MCU_UART ENABLE #define HUNTING_IR_LED_940 ENABLE #define SF_EXIF_MN_BUF_SIZE 256 -#define SF_BASE_VERSION "7MR5RCwDC04" +#define SF_BASE_VERSION "7MR5RCwDC05" #define HW_S530 DISABLE #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ #define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ diff --git a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index f6263c633..22dfe1b7a 100755 --- a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -945,7 +945,7 @@ #define HUNTING_MCU_UART ENABLE #define HUNTING_IR_LED_940 ENABLE #define SF_EXIF_MN_BUF_SIZE 256 -#define SF_BASE_VERSION "7MR5RCwDC04" +#define SF_BASE_VERSION "7MR5RCwDC05" #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ #define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ #define PHOTO_THUMB_PATH "A:\\THUMB\\" From 6b5acd8890fc6153c3cc2679071246be72d2000b Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Fri, 22 Dec 2023 11:34:52 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c | 5 ++++- loader/Project/Model/tmp_awk1 | 0 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 loader/Project/Model/tmp_awk1 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 f72e1e722..82ddeb6f4 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 @@ -2045,6 +2045,9 @@ void UIFlowPhotoEventCallback(lv_obj_t* obj, lv_event_t event) { case LV_PLUGIN_EVENT_SCR_OPEN: { + + UIFlowPhoto_ScrOpen(obj);//LV_ALIGN_IN_RIGHT_MID + #define PASSWORD_OPENED 1 #define PASSWORD_NOT_OPENED 0 static int passwordOpened = PASSWORD_NOT_OPENED; @@ -2058,7 +2061,7 @@ void UIFlowPhotoEventCallback(lv_obj_t* obj, lv_event_t event) passwordOpened = PASSWORD_OPENED; } - UIFlowPhoto_ScrOpen(obj);//LV_ALIGN_IN_RIGHT_MID + if(preview_info_task == NULL && g_preview_info_msgbox == NULL && g_preview_info_label == NULL){ g_preview_info_msgbox = lv_btn_create(obj, button_msg_bg_scr_uiflowwrnmsg); diff --git a/loader/Project/Model/tmp_awk1 b/loader/Project/Model/tmp_awk1 new file mode 100644 index 000000000..e69de29bb