diff --git a/BSP/root-fs/rootfs/etc_Model/etc_565_HUNTING_EVB_LINUX_4G_S550/init.d/S07_SysInit b/BSP/root-fs/rootfs/etc_Model/etc_565_HUNTING_EVB_LINUX_4G_S550/init.d/S07_SysInit index 1d49975e0..6f507a2ce 100755 --- a/BSP/root-fs/rootfs/etc_Model/etc_565_HUNTING_EVB_LINUX_4G_S550/init.d/S07_SysInit +++ b/BSP/root-fs/rootfs/etc_Model/etc_565_HUNTING_EVB_LINUX_4G_S550/init.d/S07_SysInit @@ -72,10 +72,16 @@ insmod /etc/lib/modules/$KERVER/extra/fs/exfat/exfat.ko #mdev -s -# Scan for without insert card -if [ ! -f /tmp/.nvt_mounts ]; then - /etc/mdev-script/autosd.sh - rm -rf /tmp/.nvt_mounts; +if [ -d "/sys/class/block/mmcblk0p1" ]; then + mknod /dev/mmcblk0p1 b `cat /sys/class/block/mmcblk0p1/dev | sed "s/:/\ /g"` +fi + +if [ -d "/sys/class/block/mmcblk1p1" ]; then + mknod /dev/mmcblk1p1 b `cat /sys/class/block/mmcblk1p1/dev | sed "s/:/\ /g"` fi -echo "fs" > /proc/nvt_info/bootts +# Scan for without insert card +if [ ! -f /tmp/.nvt_mounts ]; then + /etc/mdev-script/autosd.sh + rm -rf /tmp/.nvt_mounts; +fi diff --git a/BSP/root-fs/rootfs/etc_Model/etc_565_HUNTING_EVB_LINUX_4G_S550/init.d/S10_SysInit2 b/BSP/root-fs/rootfs/etc_Model/etc_565_HUNTING_EVB_LINUX_4G_S550/init.d/S10_SysInit2 index 6ca4560e6..7d8e9c468 100755 --- a/BSP/root-fs/rootfs/etc_Model/etc_565_HUNTING_EVB_LINUX_4G_S550/init.d/S10_SysInit2 +++ b/BSP/root-fs/rootfs/etc_Model/etc_565_HUNTING_EVB_LINUX_4G_S550/init.d/S10_SysInit2 @@ -201,8 +201,6 @@ ${PREFIX}/lib/modules/$KERVER/hdal/kdrv_videoout/fbdev/nvt_fb.ko #insmod ${PREFIX}/lib/modules/$KERVER/hdal/comm/usb2dev/nvt_usb2dev.ko #fi -mount /dev/mmcblk1p1 /mnt/sd2 - if [ -f /usr/bin/isp_demon ]; then /usr/bin/isp_demon else diff --git a/BSP/u-boot/board/novatek/nvt-na51089/na51089evb.c b/BSP/u-boot/board/novatek/nvt-na51089/na51089evb.c index beebcb829..1ae1041f4 100755 --- a/BSP/u-boot/board/novatek/nvt-na51089/na51089evb.c +++ b/BSP/u-boot/board/novatek/nvt-na51089/na51089evb.c @@ -155,7 +155,7 @@ static int nvt_handle_fw_abin(void) { int ret = 0; char cmdline[1024] = {0}; - char buf[1024] = {0}; + char buf[512] = {0}; int ota_upgrade_sts = 0; int is_ota = 0; if(WDT_OTA_GET_STS() == WDT_OTA_MAKEFOURCC(WDT_OTA_STS_LOADER_DETECTING_FW)) @@ -216,21 +216,27 @@ static int nvt_handle_fw_abin(void) } } else{ printf("%s%s:%d Update successfully %s\r\n", ANSI_COLOR_YELLOW, __FUNCTION__, __LINE__, ANSI_COLOR_RESET); - ota_upgrade_sts = 1; if(is_ota) WDT_OTA_SET_STS(WDT_OTA_STS_UBOOT_UPDATE_OK); + + ota_upgrade_sts = 1; } /* * To handle bootargs expanding for the kernel /proc/cmdline and uboot mtdids env setting */ - sprintf(buf,"%s ",env_get("bootargs")); + //printf("%s:%d ota_upgrade_sts:%d\n", __FUNCTION__, __LINE__ ,ota_upgrade_sts); + + snprintf(buf, sizeof(buf), env_get("bootargs")); + //sprintf(buf,"%s ",env_get("bootargs")); + //printf("%s:%d ota_upgrade_sts:%d\n", __FUNCTION__, __LINE__ ,ota_upgrade_sts); + strcat(cmdline, buf); ret = nvt_part_config((char *)cmdline, NULL); if (ret < 0) return ret; - if (ota_upgrade_sts == 1) { + if (ota_upgrade_sts != 0) { strcat(cmdline, "ota_flag=0x1"); } diff --git a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index dee0bdacc..b0f55e2b7 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -924,7 +924,7 @@ #define HUNTING_MCU_UART ENABLE #define HUNTING_IR_LED_940 ENABLE #define SF_EXIF_MN_BUF_SIZE 256 -#define SF_BASE_VERSION "7MR5RCwDC05" +#define SF_BASE_VERSION "7MR5RCwDC07" #define HW_S530 DISABLE #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ #define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ @@ -981,6 +981,8 @@ #endif #define SF_NO_SD_SEND ENABLE #define SF_SD_LOG_INFO_FILENAME "/tmp/SD.txt" + +#define SF_4G_MODE_TEST DISABLE //////////////////////sf end/////////////////////////////// /******************************************************************************************* diff --git a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c index 8dad83164..048d523d0 100755 --- a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c +++ b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c @@ -18,7 +18,7 @@ #include #include #include - +#include "sf_mcu.h" typedef struct { int event; @@ -81,6 +81,11 @@ void SF_StrgUnInit(void) pMMCDev = NULL; } +int SF_GetMMCDevHandle(MMC_DEV_TYPE dev_type) +{ + return sf_mmc_dev[dev_type]->dcf_handle; +} + void SF_StrgSetDcfHandle(UINT32 strg_id, UINT32 handle) { sf_mmc_dev[strg_id]->dcf_handle = handle; @@ -90,7 +95,12 @@ static UINT32 SF_StrgSpaceCheckFull(MMC_DEV_TYPE mmc_dev) { UINT64 diskFree = 0; UINT32 ret = 0; - + #if HUNTING_CAMERA_MCU == ENABLE + if(sf_get_power_off_flag() || sf_is_usb_flag()) + { + return ret; + } + #endif /*check disk free size*/ if(mmc_dev == MMC_DEV_SD) { @@ -341,7 +351,7 @@ static void* mmc_monitoring_thread(void *arg) int sf_mmc_dev_check_start(void) { - SF_StrgInit();// 初始化sf_mmc设备Obj + SF_StrgInit();// 初始化sf_mmc设备Obj int ret = pthread_create(&MMCMonitorTskCfg.TskId, NULL, mmc_monitoring_thread, NULL); if(ret != SF_SUCCESS) diff --git a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.h b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.h index 3f41d8abe..c480c677f 100755 --- a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.h +++ b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.h @@ -87,7 +87,7 @@ SF_ST_MMC_DEV *SF_StrgCheckWorkableDev(void); void SF_SetMMCDev(SF_ST_MMC_DEV *pDev); SF_ST_MMC_DEV *SF_GetMMCDev(void); int sf_mmc_dev_check_start(void); - +int SF_GetMMCDevHandle(MMC_DEV_TYPE dev_type); diff --git a/code/application/source/cardv/SrcCode/System/SysStrg_CB.c b/code/application/source/cardv/SrcCode/System/SysStrg_CB.c index afa884a29..8095a2660 100755 --- a/code/application/source/cardv/SrcCode/System/SysStrg_CB.c +++ b/code/application/source/cardv/SrcCode/System/SysStrg_CB.c @@ -54,7 +54,7 @@ void Strg_CB(UINT32 event, UINT32 param1, UINT32 param2) SF_MESSAGE_BUF_S stMessageBuf = {0}; #endif - DBG_IND("Strg_CB: strg_id = %d, status = %d\n", param1, param2); + printf("Strg_CB: strg_id = %d, status = %d\n", param1, param2); switch (event) { // part-1 case SYSTEM_CB_CONFIG: diff --git a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index 2531ae26d..bc5c59a50 100644 --- a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -1218,20 +1218,12 @@ INT32 System_OnStrgAttach(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) } #if HUNTING_CAMERA_MCU == ENABLE - if((FS_DISK_ERROR == System_GetState(SYS_STATE_FS))){ stMessageBuf.arg1 = CMD_SD_STRG_CB_UNMOUNT_FINISH; stMessageBuf.arg2 = strg_id; stMessageBuf.cmdId = CMD_SD; sf_com_message_send_to_app(&stMessageBuf); #if USE_MMC_DEV_CHECK - - if(strg_id == 1) - { - printf("emmc mounted failed, remount\n"); - system("mount /dev/mmcblk1p1 /mnt/sd2"); - stMessageBuf.arg1 = CMD_SD_STRG_CB_MOUNT_FINISH; - } SF_StrgRegister(&stMessageBuf); #endif printf("System_OnStrgAttach send UNMOUNT! dev_id = %d\n", strg_id); diff --git a/code/application/source/cardv/SrcCode/System/SysUsb_Exe.c b/code/application/source/cardv/SrcCode/System/SysUsb_Exe.c index 0591d6cae..d2a00575c 100755 --- a/code/application/source/cardv/SrcCode/System/SysUsb_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysUsb_Exe.c @@ -168,7 +168,7 @@ static BOOL System_InsmodUsb(BOOL isHost) if(isHost == FALSE){ #if HUNTING_CAMERA_MCU == ENABLE - sf_set_msdc_clk(); + //sf_set_msdc_clk(); sf_usb_mux_s(0); vos_util_delay_ms(200); #endif diff --git a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c index d7d354bc8..66f02929b 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c @@ -766,12 +766,40 @@ UINT32 PhotoExe_GetFreePicNum(void) UINT32 PhotoExe_GetTotalPicNum(void) { - UINT64 uiSpace; + UINT64 uiSpace = 0; UINT32 totalImgNum; UINT32 reserveSize = 0x80000; // 500KB UINT32 CaptureSize; UINT32 size; +#if USE_MMC_DEV_CHECK + + SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev(); + if(mmc_dev == NULL) + { + DBG_ERR("No MMC_Dev Can use!\n"); + return 0; + } + if(mmc_dev->dcf_handle < 0) + { + DBG_ERR("dcf_handle err!\n"); + return 0; + } + +#endif + +#if USE_MMC_DEV_CHECK + + if(mmc_dev->dev_type == MMC_DEV_SD) + { + uiSpace = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE); + } + else if(mmc_dev->dev_type == MMC_DEV_EMMC) + { + uiSpace = FileSys_GetDiskInfoEx('B', FST_INFO_DISK_SIZE); + } +#else uiSpace = FileSys_GetDiskInfo(FST_INFO_DISK_SIZE); +#endif //DBG_IND("[cap]Free Space = %d KB\r\n", uiSpace / 1024); diff --git a/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c index 648ccdd11..6144b5d24 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c @@ -15,6 +15,7 @@ #include "UIApp/Network/UIAppWiFiCmd.h" #include "GxStrg.h" #include "GxVideoFile.h" +#include "DCF.h" #define PB_FILE_FMT PBFMT_JPG | PBFMT_WAV | PBFMT_AVI | PBFMT_MOVMJPG | PBFMT_MP4 | PBFMT_TS #define RTSP_PLAY_FUNC DISABLE @@ -275,7 +276,13 @@ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) pFlist->Config(PBX_FLIST_CONFIG_SUPPORT_LONGNAME, 1, 0); PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)pFlist); } else { - PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)PBXFList_DCF_getObject()); + extern DCF_HANDLE System_Get_DCF_Handle(void); + + PPBX_FLIST_OBJ pFlist = PBXFList_DCF_getObject(); + DCF_HANDLE handle = System_Get_DCF_Handle(); + + pFlist->Config(PBX_FLIST_CONFIG_DCF_HANDLE, (UINT32)handle, 0); + PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)pFlist); } PB_SetParam(PBPRMID_DEC_VIDEO_CALLBACK, (UINT32)PBDecVideoCB); PB_SetParam(PBPRMID_ONDRAW_CALLBACK, (UINT32)PBView_OnDrawCB); diff --git a/code/application/source/cardv/SrcCode/UIApp/Play/UIPlayComm.c b/code/application/source/cardv/SrcCode/UIApp/Play/UIPlayComm.c index 9bffa3b03..1a0d1b980 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Play/UIPlayComm.c +++ b/code/application/source/cardv/SrcCode/UIApp/Play/UIPlayComm.c @@ -15,6 +15,7 @@ #define __DBGFLT__ "*" //*=All, [mark]=CustomClass #include +extern DCF_HANDLE System_Get_DCF_Handle(void); void CloseAutoHideTimer(void) { @@ -61,11 +62,13 @@ void ChkKeySoundComm(void) static BOOL gbNoFile = TRUE; + static void xUIPlay_Filesys_DelCB(FIND_DATA *pFindData, BOOL *bDelete, UINT32 Param1, UINT32 Param2) { INT32 fileNum; UINT32 fileType; - UINT32 filterType = (DCF_GetDBInfo(DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfo(DCF_INFO_DEP_FILE_FMT)); + DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); + UINT32 filterType = (DCF_GetDBInfoEx(dcf_handle, DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfoEx(dcf_handle, DCF_INFO_DEP_FILE_FMT)); UINT8 attrib; attrib = pFindData->attrib; @@ -85,7 +88,8 @@ static void xUIPlay_Filesys_LockCB(FIND_DATA *pFindData, BOOL *bApply, UINT32 Pa { INT32 fileNum; UINT32 fileType; - UINT32 filterType = (DCF_GetDBInfo(DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfo(DCF_INFO_DEP_FILE_FMT)); + DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); + UINT32 filterType = (DCF_GetDBInfoEx(dcf_handle, DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfoEx(dcf_handle, DCF_INFO_DEP_FILE_FMT)); DBG_IND("FileName = %s\r\n", pFindData->FATMainName); @@ -102,14 +106,15 @@ static void xUIPlay_FList_DCF_DelAll(void) char path[DCF_FULL_FILE_PATH_LEN]; BOOL ret; UINT32 i, uiMaxDirNum; + DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); - uiMaxDirNum = DCF_GetDBInfo(DCF_INFO_MAX_DIR_ID); + uiMaxDirNum = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_MAX_DIR_ID); for (i = 100; i <= uiMaxDirNum; i++) { // check if folder has file - ret = DCF_GetDirInfo(i, &dirinfo); + ret = DCF_GetDirInfoEx(dcf_handle, i, &dirinfo); if (ret /*&& dirinfo.uiNumOfDcfObj*/) { // delete all in one folder - DCF_GetDirPath(i, path); + DCF_GetDirPathEx(dcf_handle, i, path); gbNoFile = TRUE; FileSys_DelDirFiles(path, xUIPlay_Filesys_DelCB); // delete empty folder @@ -120,7 +125,7 @@ static void xUIPlay_FList_DCF_DelAll(void) } } } - DCF_Refresh(); + DCF_RefreshEx(dcf_handle); } static ER xUIPlay_FList_FDB_ProtectFile(UINT32 cmdID) { @@ -191,13 +196,14 @@ static void xUIPlay_FList_DCF_LockAll(BOOL bLock) SDCFDIRINFO dirinfo = {0}; char path[DCF_FULL_FILE_PATH_LEN] = {0}; UINT32 i, uiMaxDirNum; + DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); - uiMaxDirNum = DCF_GetDBInfo(DCF_INFO_MAX_DIR_ID); + uiMaxDirNum = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_MAX_DIR_ID); for (i = 100; i <= uiMaxDirNum; i++) { // check if folder has file - if (DCF_GetDirInfo(i, &dirinfo)) { + if (DCF_GetDirInfoEx(dcf_handle, i, &dirinfo)) { if (dirinfo.uiNumOfDcfObj) { - DCF_GetDirPath(i, path); + DCF_GetDirPathEx(dcf_handle, i, path); FileSys_LockDirFiles(path, bLock, xUIPlay_Filesys_LockCB); } } @@ -209,6 +215,7 @@ static ER xUIPlay_FList_DCF_ProtectFile(UINT32 cmdID) char filePath[DCF_FULL_FILE_PATH_LEN]; UINT32 index, i, uiThisFileFormat, tmpFileType; BOOL bLock; + DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); DBG_IND("cmdID=%d\r\n", cmdID); if ((cmdID == PLAY_PROTECT_ONE) || (cmdID == PLAY_UNPROTECT_ONE)) { @@ -217,13 +224,13 @@ static ER xUIPlay_FList_DCF_ProtectFile(UINT32 cmdID) } else { bLock = FALSE; // unlock } - index = DCF_GetCurIndex(); - uiThisFileFormat = DCF_GetDBInfo(DCF_INFO_CUR_FILE_TYPE); + index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX); + uiThisFileFormat = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_FILE_TYPE); for (i = 0; i <= DCF_FILE_TYPE_NUM; i++) { tmpFileType = 1; tmpFileType <<= i; if (uiThisFileFormat & tmpFileType) { - DCF_GetObjPath(index, tmpFileType, filePath); + DCF_GetObjPathEx(dcf_handle, index, tmpFileType, filePath); FileSys_SetAttrib(filePath, FST_ATTRIB_READONLY, bLock); } } @@ -361,6 +368,9 @@ static ER xUIPlay_FList_FDB_DelFile(UINT32 cmdID) static ER xUIPlay_FList_DCF_DelFile(UINT32 cmdID) { DBG_IND("cmdID=%d\r\n", cmdID); + + DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); + if (cmdID == PB_DELETE_ONE) { //#NT#2016/05/24#Ben Wang -begin //#NT#Fix the coverity issue. @@ -368,14 +378,14 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32 cmdID) //#NT#2016/05/24#Ben Wang -end CHAR filePath[DCF_FULL_FILE_PATH_LEN] = {0}; - index = DCF_GetCurIndex(); - uiThisFileFormat = DCF_GetDBInfo(DCF_INFO_CUR_FILE_TYPE); + index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX); + uiThisFileFormat = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_FILE_TYPE); for (i = 0; i <= DCF_FILE_TYPE_NUM; i++) { tmpFileType = 0x0001 << i; if (uiThisFileFormat & tmpFileType) { - if (DCF_GetObjPath(index, uiThisFileFormat, filePath)) { + if (DCF_GetObjPathEx(dcf_handle, index, uiThisFileFormat, filePath)) { if (FST_STA_OK == FileSys_DeleteFile(filePath)) { - DCF_DelDBfile(filePath); + DCF_DelDBfileEx(dcf_handle, filePath); } } } @@ -387,9 +397,9 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32 cmdID) UINT32 DirID = 0, FileID = 0, Index = 0, uiThisFileFormat = 0; BOOL isCurrFileReadOnly = FALSE; - Index = DCF_GetDBInfo(DCF_INFO_CUR_INDEX); - DCF_GetObjInfo(Index, &DirID, &FileID, &uiThisFileFormat); - DCF_GetObjPath(Index, uiThisFileFormat, filePath); + Index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX); + DCF_GetObjInfoEx(dcf_handle, Index, &DirID, &FileID, &uiThisFileFormat); + DCF_GetObjPathEx(dcf_handle, Index, uiThisFileFormat, filePath); ret = FileSys_GetAttrib(filePath, &attrib); if ((ret == E_OK) && M_IsReadOnly(attrib) == TRUE) { @@ -399,10 +409,10 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32 cmdID) // --------- delete all files ----------------------- xUIPlay_FList_DCF_DelAll(); if (isCurrFileReadOnly) { - Index = DCF_GetIndexByID(DirID, FileID); - DCF_SetCurIndex(Index); + Index = DCF_GetIndexByIDEx(dcf_handle, DirID, FileID); + DCF_SetCurIndexEx(dcf_handle, Index); } - DCF_Refresh(); + DCF_RefreshEx(dcf_handle); } return E_OK; } diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM.rar b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM.rar index 3eaa6b61f..a5b4a7756 100644 Binary files a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM.rar and b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM.rar differ diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPlay.lvglscr b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPlay.lvglscr index ef36c8282..52f8d02b8 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPlay.lvglscr +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPlay.lvglscr @@ -1707,7 +1707,7 @@ "X": 0, "Y": 0 }, - "source": "sf_delete", + "source": "sf_Exit", "styles": [ { "part": 0, @@ -1759,7 +1759,7 @@ "X": 0, "Y": 0 }, - "source": "sf_Exit", + "source": "sf_delete", "styles": [ { "part": 0, @@ -3285,6 +3285,68 @@ } ], "widget": "Container" + }, + { + "class": "lv_cont", + "click": true, + "drag": false, + "event callback": "", + "geometry": { + "height": 40, + "width": 320, + "x": 5, + "y": 0 + }, + "hidden": true, + "layout": "Off", + "locked": false, + "name": "container_option_title", + "styles": [ + { + "Background": { + "bg_color": "0x666666", + "bg_opa": 0 + }, + "Border": { + "border_color": "0xdddddd", + "border_opa": 0, + "border_width": 0 + }, + "Mix": { + "radius": 0 + }, + "Padding": { + "pad_inner": 5 + }, + "part": 0, + "state": 0 + }, + { + "part": 0, + "state": 1 + }, + { + "part": 0, + "state": 2 + }, + { + "part": 0, + "state": 3 + }, + { + "part": 0, + "state": 4 + }, + { + "part": 0, + "state": 5 + }, + { + "part": 0, + "state": 6 + } + ], + "widget": "Container" } ] } 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 60c8954d3..871e907e3 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,12 +694,22 @@ 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) + { + 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, "true"); } else if (ret == 0) { 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) + { + lv_label_set_text(labelInit, "Please insert SIM card and restart the camera"); + return; + } snprintf(qr_date, QR_DATA_LENGTH, qr_code_str, puiPara->ModuleImei, puiPara->SimIccidV, puiPara->SimIccidA, "false"); } else if (ret == -1) 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 71338921e..0c5aa5dbd 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 @@ -905,11 +905,11 @@ 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) { + // 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; - } + // UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms); + // return; + // } } else if (System_GetState(SYS_STATE_POWERON) == SYSTEM_POWERON_NORMAL) { @@ -920,11 +920,11 @@ static void UIFlowMovie_OnExeRecord(lv_obj_t* obj) } - if (System_GetState(SYS_STATE_CARD) == CARD_REMOVED) { + // 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; - } + // UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms); + // return; + // } } 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 f9c6c172e..b56488920 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 @@ -672,7 +672,6 @@ static void update_gps_status(void) } int get_storage_type(void) { - return MMC_DEV_SD; SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev(); if (NULL == mmc_dev) { @@ -688,16 +687,16 @@ int get_storage_type(void) } static void update_storage_sd_card(void) { - if (System_GetState(SYS_STATE_FS) == FS_INIT_OK) + // if (System_GetState(SYS_STATE_FS) == FS_INIT_OK) { - UINT32 cardStatus = System_GetState(SYS_STATE_CARD); - if (cardStatus != CARD_REMOVED) + // UINT32 cardStatus = System_GetState(SYS_STATE_CARD); + // if (cardStatus != CARD_REMOVED) { if (g_SysStrg_Chg) { static int cnt = 0; if(cnt++<1){ - lv_label_set_text(label_6_scr_uiflowphoto, "Loarding..."); + // lv_label_set_text(label_6_scr_uiflowphoto, "Loarding..."); }else{ g_SysStrg_Chg = false; cnt = 0; @@ -705,7 +704,7 @@ static void update_storage_sd_card(void) } else if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE) { if(UIStorageCheck_DCIMWritable() == FALSE){ - lv_label_set_text(label_6_scr_uiflowphoto, "SD CARD ERROR"); + lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card"); } } else if (UIStorageCheck(STORAGE_CHECK_FULL, NULL) == TRUE) { @@ -719,17 +718,17 @@ static void update_storage_sd_card(void) lv_label_set_text(label_6_scr_uiflowphoto, Get_FreePicNumString(g_uiFreePicNum)); } } - else - { - set_warning_label_text(label_6_scr_uiflowphoto); - lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card"); - } - } - else - { - set_warning_label_text(label_6_scr_uiflowphoto); - lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card"); + // else + // { + // set_warning_label_text(label_6_scr_uiflowphoto); + // lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card"); + // } } + // else + // { + // set_warning_label_text(label_6_scr_uiflowphoto); + // lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card"); + // } } unsigned int check_sd_size(UINT64 diskSize) { @@ -774,8 +773,14 @@ static void update_sd_card_status(lv_obj_t* obj) LV_PLUGIN_IMG_ID_SF_SD_256GB, LV_PLUGIN_IMG_ID_SF_SD_FULL }; - UINT64 diskSize = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE); - unsigned int index = check_sd_size(diskSize); + UINT64 diskSize = 0; + unsigned int index = 0; + UINT32 cardStatus = System_GetState(SYS_STATE_CARD); + if (cardStatus != CARD_REMOVED) + { + diskSize = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE); + index = check_sd_size(diskSize); + } if (index > 7) { return; @@ -947,6 +952,12 @@ static void update_dzoom(void) static void update_icons(void) { // printf(" update_icons\n "); + #if HUNTING_CAMERA_MCU == ENABLE + if(sf_get_power_off_flag() || sf_is_usb_flag()) + { + return; + } + #endif update_selftimer(); update_size(); update_quality(); @@ -2139,8 +2150,10 @@ void UIFlowPhotoEventCallback(lv_obj_t* obj, lv_event_t event) #define PASSWORD_OPENED 1 #define PASSWORD_NOT_OPENED 0 static int passwordOpened = PASSWORD_NOT_OPENED; + printf("[***************x]check password"); if(PASSWORD_SWITCH_ON == puiPara->PwdSwitch && PASSWORD_NOT_OPENED == passwordOpened) { + printf("[***************x]password open"); passwordOpened = PASSWORD_OPENED; OpenPasswordScreen(); ShutDownTime = PASSWORD_GO_TO_WORK_MODE_TIME_S; diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoFuncs.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoFuncs.c index f030b989a..9c0f3714d 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoFuncs.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoFuncs.c @@ -14,6 +14,8 @@ #define __DBGFLT__ "*" //*=All, [mark]=CustomClass #include +#include "SF_SysStrgMng.h" + PHOTO_TASK_DATA gPhotoData = { 0 }; static UINT32 g_uiFreePicNum = 0; @@ -28,7 +30,29 @@ CHAR *Get_FreePicNumString(UINT32 uiValue) return 0; } unsigned long fileCount = 0; +#if USE_MMC_DEV_CHECK + + SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev(); + if(mmc_dev == NULL) + { + DBG_ERR("No MMC_Dev Can use!\n"); + return NULL; + } + if(mmc_dev->dcf_handle < 0) + { + DBG_ERR("dcf_handle err!\n"); + return NULL; + } +#endif + +#if USE_MMC_DEV_CHECK + if(mmc_dev->dev_type != MMC_DEV_NO) + { + fileCount = DCF_GetDBInfoEx(mmc_dev->dcf_handle, DCF_INFO_TOL_FILE_COUNT); + } +#else fileCount = DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT); +#endif snprintf(g_cFreePicNumStr, sizeof(g_cFreePicNumStr), "%05ld/%05ld", fileCount, uiValue); return g_cFreePicNumStr; } diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlay.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlay.c index b1c4e4158..8ff2318ea 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlay.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlay.c @@ -59,6 +59,7 @@ lv_obj_t* image_option4_scr_uiflowplay; lv_obj_t* image_button_option_5_scr_uiflowplay; lv_obj_t* label_option5_scr_uiflowplay; lv_obj_t* image_option5_scr_uiflowplay; +lv_obj_t* container_option_title_scr_uiflowplay; lv_obj_t* UIFlowPlay_create(){ lv_obj_t *parent = lv_plugin_scr_create(); @@ -1498,7 +1499,7 @@ lv_obj_t* UIFlowPlay_create(){ lv_obj_set_drag(image_exit, false); lv_obj_set_pos(image_exit, 135, 0); lv_obj_set_size(image_exit, 32, 40); - lv_img_set_src(image_exit, &sf_delete); + lv_img_set_src(image_exit, &sf_exit); lv_obj_add_style(image_exit, 0, &image_exit_s0); image_exit_scr_uiflowplay = image_exit; @@ -1547,7 +1548,7 @@ lv_obj_t* UIFlowPlay_create(){ lv_obj_set_drag(image_delete, false); lv_obj_set_pos(image_delete, 214, 0); lv_obj_set_size(image_delete, 32, 40); - lv_img_set_src(image_delete, &sf_exit); + lv_img_set_src(image_delete, &sf_delete); lv_obj_add_style(image_delete, 0, &image_delete_s0); image_delete_scr_uiflowplay = image_delete; @@ -2857,5 +2858,44 @@ lv_obj_t* UIFlowPlay_create(){ image_option5_scr_uiflowplay = image_option5; + static lv_style_t container_option_title_s0; + lv_style_init(&container_option_title_s0); + lv_style_set_radius(&container_option_title_s0,LV_STATE_DEFAULT,0); + lv_style_set_pad_inner(&container_option_title_s0,LV_STATE_DEFAULT,5); + STYLE_COLOR_PROP(0x8b, 0x66, 0x66, 0x66) ; lv_style_set_bg_color(&container_option_title_s0, LV_STATE_DEFAULT, color); + lv_style_set_bg_opa(&container_option_title_s0,LV_STATE_DEFAULT,0); + STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&container_option_title_s0, LV_STATE_DEFAULT, color); + STYLE_COLOR_PROP(0xe9, 0xdd, 0xdd, 0xdd) ; lv_style_set_border_color(&container_option_title_s0, LV_STATE_DEFAULT, color); + lv_style_set_border_opa(&container_option_title_s0,LV_STATE_DEFAULT,0); + lv_style_set_border_width(&container_option_title_s0,LV_STATE_DEFAULT,0); + STYLE_COLOR_PROP(0x8b, 0x66, 0x66, 0x66) ; lv_style_set_bg_color(&container_option_title_s0, LV_STATE_CHECKED, color); + STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&container_option_title_s0, LV_STATE_CHECKED, color); + STYLE_COLOR_PROP(0xe9, 0xdd, 0xdd, 0xdd) ; lv_style_set_border_color(&container_option_title_s0, LV_STATE_CHECKED, color); + STYLE_COLOR_PROP(0x8b, 0x66, 0x66, 0x66) ; lv_style_set_bg_color(&container_option_title_s0, LV_STATE_FOCUSED, color); + STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&container_option_title_s0, LV_STATE_FOCUSED, color); + STYLE_COLOR_PROP(0xe9, 0xdd, 0xdd, 0xdd) ; lv_style_set_border_color(&container_option_title_s0, LV_STATE_FOCUSED, color); + STYLE_COLOR_PROP(0x8b, 0x66, 0x66, 0x66) ; lv_style_set_bg_color(&container_option_title_s0, LV_STATE_EDITED, color); + STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&container_option_title_s0, LV_STATE_EDITED, color); + STYLE_COLOR_PROP(0xe9, 0xdd, 0xdd, 0xdd) ; lv_style_set_border_color(&container_option_title_s0, LV_STATE_EDITED, color); + STYLE_COLOR_PROP(0x8b, 0x66, 0x66, 0x66) ; lv_style_set_bg_color(&container_option_title_s0, LV_STATE_HOVERED, color); + STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&container_option_title_s0, LV_STATE_HOVERED, color); + STYLE_COLOR_PROP(0xe9, 0xdd, 0xdd, 0xdd) ; lv_style_set_border_color(&container_option_title_s0, LV_STATE_HOVERED, color); + STYLE_COLOR_PROP(0x8b, 0x66, 0x66, 0x66) ; lv_style_set_bg_color(&container_option_title_s0, LV_STATE_PRESSED, color); + STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&container_option_title_s0, LV_STATE_PRESSED, color); + STYLE_COLOR_PROP(0xe9, 0xdd, 0xdd, 0xdd) ; lv_style_set_border_color(&container_option_title_s0, LV_STATE_PRESSED, color); + STYLE_COLOR_PROP(0x8b, 0x66, 0x66, 0x66) ; lv_style_set_bg_color(&container_option_title_s0, LV_STATE_DISABLED, color); + STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&container_option_title_s0, LV_STATE_DISABLED, color); + STYLE_COLOR_PROP(0xe9, 0xdd, 0xdd, 0xdd) ; lv_style_set_border_color(&container_option_title_s0, LV_STATE_DISABLED, color); + lv_obj_t *container_option_title = lv_cont_create(parent, NULL); + lv_obj_set_hidden(container_option_title, true); + lv_obj_set_click(container_option_title, true); + lv_obj_set_drag(container_option_title, false); + lv_obj_set_pos(container_option_title, 5, 0); + lv_obj_set_size(container_option_title, 320, 40); + lv_obj_add_style(container_option_title, 0, &container_option_title_s0); + + container_option_title_scr_uiflowplay = container_option_title; + + return parent; } diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlay.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlay.h index 379604c7a..1f5b7b9d8 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlay.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlay.h @@ -67,6 +67,7 @@ extern lv_obj_t* image_option4_scr_uiflowplay; extern lv_obj_t* image_button_option_5_scr_uiflowplay; extern lv_obj_t* label_option5_scr_uiflowplay; extern lv_obj_t* image_option5_scr_uiflowplay; +extern lv_obj_t* container_option_title_scr_uiflowplay; /********************** * GLOBAL PROTOTYPES 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 53951e0c7..9ba5948f5 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 @@ -17,7 +17,7 @@ #include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h" #include "UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmAPI.h" #include "kwrap/nvt_type.h" - +#include "SF_SysStrgMng.h" #if (USE_DCF == ENABLE) #include "DCF.h" #endif @@ -27,8 +27,8 @@ //#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 lv_obj_t* pMenu = NULL; +static SF_ST_MMC_DEV *mmc_dev = NULL; +//static lv_obj_t* pMenu = NULL; enum SELECTION_SHOW { SELECTION_SHOW_TURE = 0, @@ -75,112 +75,155 @@ extern uint16_t warn_msgbox_auto_close_ms; //static lv_obj_t* curr_pressbtn; #define ITEMS_PER_PAGE 5 + +void init_bar(void) +{ + lv_obj_set_state(container_option_title_scr_uiflowplay, LV_STATE_DEFAULT); + lv_obj_set_hidden(container_option_title_scr_uiflowplay, false); +} + +void hidde_bar(void) +{ + lv_obj_set_hidden(container_option_title_scr_uiflowplay, true); +} + static void update_play_Selection_msg(lv_obj_t* obj) { for(int i = 0; i < ITEMS_PER_PAGE; i++) { - if(i == 0){ - if (ProfileFocused == i) { - 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_obj_set_hidden(image_option1_scr_uiflowplay, false); - lv_plugin_img_set_src(image_option1_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_LIST_SELECTED_NEXT2); - lv_obj_set_pos(image_option1_scr_uiflowplay, 259, 0); - } else { - lv_obj_set_state(image_button_option_1_scr_uiflowplay, LV_STATE_DEFAULT); - lv_obj_set_state(label_option1_scr_uiflowplay, LV_STATE_DEFAULT); - // lv_obj_set_hidden(image_option1_scr_uiflowplay, false); - lv_plugin_img_set_src(image_option1_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_NEXT1); - lv_obj_set_pos(image_option1_scr_uiflowplay, 288, 0); - } - } else if(i == 1){ - if (ProfileFocused == i) { - lv_obj_set_state(image_button_option_2_scr_uiflowplay, LV_STATE_FOCUSED); - lv_obj_set_state(label_option2_scr_uiflowplay, LV_STATE_FOCUSED); - // lv_obj_set_hidden(image_option2_scr_uiflowplay, false); - lv_plugin_img_set_src(image_option2_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_LIST_SELECTED_NEXT2); - lv_obj_set_pos(image_option2_scr_uiflowplay, 259, 0); - } else { - lv_obj_set_state(image_button_option_2_scr_uiflowplay, LV_STATE_DEFAULT); - lv_obj_set_state(label_option2_scr_uiflowplay, LV_STATE_DEFAULT); - // lv_obj_set_hidden(image_option2_scr_uiflowplay, false); - lv_plugin_img_set_src(image_option2_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_NEXT1); - lv_obj_set_pos(image_option2_scr_uiflowplay, 288, 0); - } - }else if(i == 2){ + if (i == 2) + { if (ProfileFocused == i) { lv_obj_set_state(image_button_option_3_scr_uiflowplay, LV_STATE_FOCUSED); } else { lv_obj_set_state(image_button_option_3_scr_uiflowplay, LV_STATE_DEFAULT); } - }else if(i == 3){ + } + else if (i == 3) + { if (ProfileFocused == i) { lv_obj_set_state(image_button_option_4_scr_uiflowplay, LV_STATE_FOCUSED); } else { lv_obj_set_state(image_button_option_4_scr_uiflowplay, LV_STATE_DEFAULT); } - }else if(i == 4){ + } + else if (i == 4) + { if (ProfileFocused == i) { lv_obj_set_state(image_button_option_5_scr_uiflowplay, LV_STATE_FOCUSED); } else { lv_obj_set_state(image_button_option_5_scr_uiflowplay, LV_STATE_DEFAULT); } } - } - return; - if(pMenu == NULL) - { - printf("[error]Network Selection abnormal operation\n"); - return; - } + else if (i == 0 && OPTION_PAGE_SELECT_FUNCTION == gOptionPage) + { + if (ProfileFocused == i) {//focused and > + lv_obj_set_state(image_button_option_1_scr_uiflowplay, LV_STATE_FOCUSED); + lv_obj_set_state(label_option1_scr_uiflowplay, LV_STATE_FOCUSED); - if(ProfileFocused > PROFILE_MAX) - { - printf("[error]ProfileFocused exceed the limit\n"); - ProfileFocused = 0; - } + lv_plugin_img_set_src(image_option1_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_NEXT2); + lv_obj_set_pos(image_option1_scr_uiflowplay, 288, 0); + } + else + { + lv_obj_set_state(image_button_option_1_scr_uiflowplay, LV_STATE_DEFAULT); + lv_obj_set_state(label_option1_scr_uiflowplay, LV_STATE_DEFAULT); - int selectedPage = ProfileFocused / ITEMS_PER_PAGE; - int ishidden = 0; + lv_plugin_img_set_src(image_option1_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_NEXT1); + lv_obj_set_pos(image_option1_scr_uiflowplay, 288, 0); + } + lv_obj_set_hidden(image_option1_scr_uiflowplay, false); + } + else if (i == 1 && OPTION_PAGE_SELECT_FUNCTION == gOptionPage) + { + if (ProfileFocused == i) {//focused and > + lv_obj_set_state(image_button_option_2_scr_uiflowplay, LV_STATE_FOCUSED); + lv_obj_set_state(label_option2_scr_uiflowplay, LV_STATE_FOCUSED); - for(int i = 0; i < ITEMS_PER_PAGE; i++) - { - // printf("i:%d data:%d\n", i, (IDS_NETWORK_SELECTION_1 + (ITEMS_PER_PAGE * selectedPage) + i)); - lv_plugin_menu_set_item_string_id(pMenu, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, - (IDS_NETWORK_SELECTION_1 + (ITEMS_PER_PAGE * selectedPage) + i)); - lv_plugin_menu_set_item_img_id(pMenu, i, LV_PLUGIN_MENU_ITEM_STATE_DISABLED, LV_PLUGIN_IMG_ID_ICON_OK); - - ishidden = true; - if((ITEMS_PER_PAGE * selectedPage) + i < ProfileTotal) - { - lv_plugin_menu_set_item_hidden(pMenu, i, false);//整项 - if((ITEMS_PER_PAGE * selectedPage) + i == ProfileFocused) - { - lv_plugin_menu_select_item(pMenu, i);//白条 - } - if((ITEMS_PER_PAGE * selectedPage) + i == ProfileSelected) - { - ishidden = false; - } - } - else - { - lv_plugin_menu_set_item_hidden(pMenu, i, true);//整项 - } - - if(i==0){ - lv_obj_set_hidden(image_option1_scr_uiflowplay, ishidden);//打钩 - }else if(i == 1){ - lv_obj_set_hidden(image_option2_scr_uiflowplay, ishidden); - }else if(i == 2){ - lv_obj_set_hidden(image_option3_scr_uiflowplay, ishidden); - }else if(i == 3){ - lv_obj_set_hidden(image_option4_scr_uiflowplay, ishidden); - }else if(i == 4){ - lv_obj_set_hidden(image_option5_scr_uiflowplay, ishidden); + lv_plugin_img_set_src(image_option2_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_NEXT2); + lv_obj_set_pos(image_option2_scr_uiflowplay, 288, 0); + } + else + { + lv_obj_set_state(image_button_option_2_scr_uiflowplay, LV_STATE_DEFAULT); + lv_obj_set_state(label_option2_scr_uiflowplay, LV_STATE_DEFAULT); + lv_plugin_img_set_src(image_option2_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_NEXT1); + lv_obj_set_pos(image_option2_scr_uiflowplay, 288, 0); + } + lv_obj_set_hidden(image_option2_scr_uiflowplay, false); } + else if (i == 0 && OPTION_PAGE_SELECT_FUNCTION != gOptionPage) + { + if (ProfileFocused == i) {//focused and √ + lv_obj_set_state(image_button_option_1_scr_uiflowplay, LV_STATE_FOCUSED); + lv_obj_set_state(label_option1_scr_uiflowplay, LV_STATE_FOCUSED); + + if (ProfileSelected == i) + { + lv_plugin_img_set_src(image_option1_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_LIST_SELECTED); + lv_obj_set_pos(image_option1_scr_uiflowplay, 272, 0); + lv_obj_set_hidden(image_option1_scr_uiflowplay, false); + } + else + { + lv_obj_set_hidden(image_option1_scr_uiflowplay, true); + } + } + else + { + lv_obj_set_state(image_button_option_1_scr_uiflowplay, LV_STATE_DEFAULT); + lv_obj_set_state(label_option1_scr_uiflowplay, LV_STATE_DEFAULT); + + if (ProfileSelected == i) + { + lv_plugin_img_set_src(image_option1_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_LIST_SELECTED); + lv_obj_set_pos(image_option1_scr_uiflowplay, 272, 0); + lv_obj_set_hidden(image_option1_scr_uiflowplay, false); + } + else + { + lv_obj_set_hidden(image_option1_scr_uiflowplay, true); + } + } + } + else if (i == 1 && OPTION_PAGE_SELECT_FUNCTION != gOptionPage) + { + if (ProfileFocused == i) {//focused and √ + lv_obj_set_state(image_button_option_2_scr_uiflowplay, LV_STATE_FOCUSED); + lv_obj_set_state(label_option2_scr_uiflowplay, LV_STATE_FOCUSED); + + if (ProfileSelected == i) + { + lv_plugin_img_set_src(image_option2_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_LIST_SELECTED); + lv_obj_set_pos(image_option2_scr_uiflowplay, 272, 0); + lv_obj_set_hidden(image_option2_scr_uiflowplay, false); + } + else + { + lv_obj_set_hidden(image_option2_scr_uiflowplay, true); + } + } + else + { + lv_obj_set_state(image_button_option_2_scr_uiflowplay, LV_STATE_DEFAULT); + lv_obj_set_state(label_option2_scr_uiflowplay, LV_STATE_DEFAULT); + + if (ProfileSelected == i) + { + lv_plugin_img_set_src(image_option2_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_LIST_SELECTED); + lv_obj_set_pos(image_option2_scr_uiflowplay, 272, 0); + lv_obj_set_hidden(image_option2_scr_uiflowplay, false); + } + else + { + lv_obj_set_hidden(image_option2_scr_uiflowplay, true); + } + } + } } } + + void show_select_function(lv_obj_t* obj) { if (OPTION_PAGE_SELECT_FUNCTION == gOptionPage) { @@ -195,17 +238,17 @@ void show_Selection_page(lv_obj_t* obj) { // pMenu = menu_obj; gSeletionShow = SELECTION_SHOW_TURE; - ProfileFocused = 0; ProfileTotal = 2; - ProfileSelected = 0; + lv_obj_set_hidden(container_main_menu_scr_uiflowplay,false); show_select_function(obj); update_play_Selection_msg(obj); } -void hide_Selection_page(void) +void hidde_Selection_page(void) { gSeletionShow = SELECTION_SHOW_FALSE; gOptionPage = OPTION_PAGE_SELECT_FUNCTION; + hidde_bar(); lv_obj_set_hidden(container_main_menu_scr_uiflowplay,true); } void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key) @@ -214,62 +257,86 @@ void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key) switch(key) { - case LV_USER_KEY_NEXT: - if(ProfileFocused >= 0 && ProfileFocused < (ProfileTotal - 1)) - { - ProfileFocused++; - } - else - { - ProfileFocused = 0; - } - update_play_Selection_msg(obj); - break; - case LV_USER_KEY_PREV: - if(ProfileFocused > 0 && ProfileFocused < ProfileTotal) - { - ProfileFocused--; - } - else - { - ProfileFocused = ProfileTotal - 1; - } - update_play_Selection_msg(obj); - break; - case LV_USER_KEY_LEFT: - // if (OPTION_PAGE_SELECT_FUNCTION == gOptionPage) { - // hide_Selection_page(); - // } else { - // gOptionPage = OPTION_PAGE_SELECT_FUNCTION; - // show_Selection_page(obj); - // } - break; - case LV_USER_KEY_RIGHT: - case LV_KEY_ENTER: - if (OPTION_PAGE_SELECT_FUNCTION == gOptionPage) { - if (1 == ProfileFocused) + case LV_USER_KEY_NEXT: + { + ProfileFocused++; + if (ProfileFocused >= ProfileTotal) { - hide_Selection_page(); - UINT32 uiFileSeq; - PB_GetParam(PBPRMID_CURR_FILESEQ, &uiFileSeq); - if (0 != uiFileSeq) - { - stop_play(); - UIFlowMenuCommonConfirmAPI_Open(IDM_DELETE_THIS); - break; - } - } else { - gOptionPage = OPTION_PAGE_FORMAT; + ProfileFocused = 0; + } + update_play_Selection_msg(obj); + break; + } + case LV_USER_KEY_PREV: + { + ProfileFocused--; + if (ProfileFocused < 0) + { + ProfileFocused = ProfileTotal - 1; + } + update_play_Selection_msg(obj); + break; + } + case LV_USER_KEY_LEFT: + { + if (OPTION_PAGE_SELECT_FUNCTION == gOptionPage) + { + hidde_Selection_page(); + } + else + { + gOptionPage = OPTION_PAGE_SELECT_FUNCTION; show_Selection_page(obj); } - } else { + break; + } + case LV_USER_KEY_RIGHT: + case LV_KEY_ENTER: + if (OPTION_PAGE_SELECT_FUNCTION == gOptionPage) { + if (1 == ProfileFocused)//DELETE + { + hidde_Selection_page(); + UINT32 uiFileSeq; + PB_GetParam(PBPRMID_CURR_FILESEQ, &uiFileSeq); + if (0 != uiFileSeq) + { + stop_play(); + UIFlowMenuCommonConfirmAPI_Open(IDM_DELETE_THIS); + break; + } + } + 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) { - printf(" ================================== switch sd card.\n"); - } else { - printf(" ================================== switch emmc.\n"); + printf(" ================================== switch sd card.\n"); + ProfileSelected = 1; + FileDB_Refresh(0); + } + else + { + printf(" ================================== switch emmc.\n"); + ProfileSelected = 0; + FileDB_Refresh(1); } - hide_Selection_page(); + ProfileFocused = 0; + hidde_Selection_page(); } break; default: @@ -1282,6 +1349,7 @@ static void UIFlowPlay_ChildScrClose(lv_obj_t* obj, const void * data) } break; case NVTRET_ENTER_MENU: + break; DBG_DUMP("NVTRET_ENTER_MENU"); //#NT#2023/11/03#Eric - begin //#NT#Support //#NT#Support IVOT_N12144_CO-148 -3 @@ -1369,7 +1437,7 @@ static void UIFlowPlay_ChildScrClose(lv_obj_t* obj, const void * data) static void UIFlowPlay_ScrClose(lv_obj_t* obj) { DBG_DUMP("%s\r\n", __func__); - hide_Selection_page(); + hidde_Selection_page(); /* do nothing if current system mode is not matched */ if (System_GetState(SYS_STATE_CURRMODE) != PRIMARY_MODE_PLAYBACK){ DBG_WRN("system current mode is not playback\r\n"); @@ -2269,12 +2337,12 @@ static void UIFlowPlay_Key(lv_obj_t* obj, uint32_t key) } break; } - - case LV_USER_KEY_UP: - case LV_USER_KEY_PREV: + case LV_USER_KEY_DOWN: + case LV_USER_KEY_NEXT: { if (SELECTION_SHOW_FALSE == gSeletionShow) { show_Selection_page(obj); + init_bar(); } else { } @@ -2283,8 +2351,8 @@ static void UIFlowPlay_Key(lv_obj_t* obj, uint32_t key) break; UIFlowPlay_OnKeyPrev(obj); } - case LV_USER_KEY_DOWN: - case LV_USER_KEY_NEXT: + case LV_USER_KEY_UP: + case LV_USER_KEY_PREV: { UIFlowPlay_Exit(obj); break; 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 0b7f6ca9b..09c1522d5 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 @@ -42,15 +42,11 @@ static void task_msgbox_timer_cb(lv_task_t* task) UINT16 autoOffTime = sf_get_auto_off_time(); const lv_plugin_string_t* string = lv_plugin_get_string(msgID); - if (6000 == autoClose) - { - sf_set_pir_statu_flag(1); - } if (0 == autoClose || autoOffTime <= 10) { - //sf_set_pir_statu_flag(0); + lv_task_del(msgbox_timer); msgbox_timer = NULL; if (msgbox) @@ -60,9 +56,10 @@ static void task_msgbox_timer_cb(lv_task_t* task) } if (0 == autoClose) { + sf_set_pir_statu_flag(1); // OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); - #define DO_NOT_SHOW_POWER_OFF 0 - Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); + //#define DO_NOT_SHOW_POWER_OFF 0 + //Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); } return; } @@ -209,9 +206,7 @@ void UIFlowWrnMsgAPI_Open_StringID(lv_plugin_res_id id, uint16_t auto_close_time void UIFlowWrnMsgEventCallback_OnOpen(lv_obj_t* obj) { - - - + evt = NVTEVT_NULL; } static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) @@ -226,7 +221,8 @@ static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA { printf("Complete format emmc.\n"); lv_plugin_msgbox_set_text(msgbox, LV_PLUGIN_STRING_ID_STRING_COMPLETED); - lv_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_COMPLETED); + // lv_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_COMPLETED); + lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "Completed!"); lv_msgbox_start_auto_close(msgbox, 3000); break; } @@ -237,7 +233,8 @@ static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA if(ret == CMD_FORMAT_SD_OK) { lv_plugin_msgbox_set_text(msgbox, LV_PLUGIN_STRING_ID_STRING_COMPLETED); - lv_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_COMPLETED); + // lv_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_COMPLETED); + lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "Completed!"); } else { diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index b487b056f..649e12777 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -198,14 +198,21 @@ #else #define DEFAULT_BOOT_WORK_MODE SF_CAM_MODE_PHOTO// #define DEFAULT_NET_WORK_NEED_SEARCH SF_ON -#define DEFAULT_AUTO_OFF_SWITCH SF_ON #define DEFAULT_PIR_SWITCH SF_ON #define DEFAULT_PIR_SENSITIVITY SF_PIR_SENSITIVITY_7 #define DEFAULT_TIMELAPSE_SWITCH SF_OFF #if SF_BATTERY_TEST == ENABLE #define DEFAULT_GPRS_SWITCH SF_OFF #else +#if SF_4G_MODE_TEST == ENABLE +#define DEFAULT_GPRS_SWITCH SF_OFF +#define DEFAULT_GPRS_MODE SF_REMOTE_CONTROL_REAL_TIME +#define DEFAULT_AUTO_OFF_SWITCH SF_OFF +#else #define DEFAULT_GPRS_SWITCH SF_ON +#define DEFAULT_GPRS_MODE SF_REMOTE_CONTROL_OFF +#define DEFAULT_AUTO_OFF_SWITCH SF_ON +#endif #endif #endif @@ -217,7 +224,6 @@ #define DEFAULT_SEND_TYPE SF_SEND_TIMELY #define DEFAULT_PIR_DELAY_SWITCH SF_OFF -#define DEFAULT_GPRS_MODE SF_REMOTE_CONTROL_OFF #define DEFAULT_DAILY_REPORT_SWITCH SF_ON #define DEFAULT_GPS_SWITCH SF_ON //#if defined(_MODEL_565_HUNTING_EVB_LINUX_4G_68CS_) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c index 394467c8b..d82e3bf24 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -2354,6 +2354,7 @@ void sf_power_on_para_check_init(void) puiPara->FristSendDailyAndGps = 1; puiPara->GpsSendFlag = 0; memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid)); + memset(puiPara->ServiceProvider,'\0',sizeof(puiPara->ServiceProvider)); } else if(PowerOnMode == PWR_ON_TIME_SYNC) { diff --git a/code/application/source/sf_app/code/source/4gMng/sf_sms.c b/code/application/source/sf_app/code/source/4gMng/sf_sms.c index 542d853e4..d733571ca 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_sms.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_sms.c @@ -2230,7 +2230,7 @@ SINT32 sf_power_off_check_sms(void) SLOGD(" s %d %d\n",sf_get_sim_insert(), sf_app_while_flag()); /*instant, hybrid mode*/ - if((!sf_get_signal_ready_flag()) && (sf_get_sim_insert()) && (sf_app_while_flag())) + if((!sf_get_signal_ready_flag()) && (sf_get_sim_insert()) && (sf_app_while_flag()) && (puiPara->GprsSwitch)) { if(puiPara->GprsMode) { diff --git a/code/application/source/sf_app/code/source/battery/sf_battery.c b/code/application/source/sf_app/code/source/battery/sf_battery.c index 14318a85c..648f16b7b 100755 --- a/code/application/source/sf_app/code/source/battery/sf_battery.c +++ b/code/application/source/sf_app/code/source/battery/sf_battery.c @@ -895,7 +895,19 @@ void sf_battery_level_polling(void) LibatCnt++; } readBatCnt++; + if(puiPara->BatteryLogSwitch) + { + printf("\nDC Adc:%d After Convert:(%d.%dV),Is Dc In=%s, TemperAdc:%d \n", sf_battery_convert_to_adc(24, 100, DcVoltageVal), DcVoltageVal / 10, DcVoltageVal % 10, IsPowerDcIn == 1? "Yes" : "No", TemperAdc); + if(LiPolymerVoltageVal) + { + printf("Li Battery Adc:%d After Convert:(%d.%dV)\n\n", sf_battery_convert_to_adc(24, 100, LiPolymerVoltageVal), LiPolymerVoltageVal / 10, LiPolymerVoltageVal % 10); + } + else + { + printf("Other Battery Adc:%d After Convert:(%d.%dV)\n\n", sf_aa_battery_convert_to_adc(24, 100, BatVoltageVal),BatVoltageVal / 10, BatVoltageVal % 10); + } + } if(readBatCnt >= 10) { _DcVoltageVal = dcTemp / 10; 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 b9eca674a..bba817877 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,17 +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_poweron_type_get()) && (PWR_ON_USB!= sf_poweron_type_get())) - { - printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__); - sf_set_power_off_flag(1); - //sf_app_battery_stop(); - system("watchdog -T 1 -t 5 /dev/watchdog"); - } - else - { - sf_com_message_send_to_cardv(&stMessageBuf); - } + sf_com_message_send_to_cardv(&stMessageBuf); } else if(0 == stMessageBuf.arg3) //ON->OFF { 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 128eb6cd4..7690d8305 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 @@ -646,7 +646,10 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val) { //sf_pdp_flg_set(0); } - + #if SF_4G_MODE_TEST == ENABLE + temp |= 0x40; /*bit6=1,instant mode*/ + temp |= 0x80; + #endif mcuData[i++] = temp; mcuReg[i] = DIGITAL_PIR_SENSITIVITY; diff --git a/code/application/source/sf_app/code/source/ttyusb/sf_hal_ttyusb.c b/code/application/source/sf_app/code/source/ttyusb/sf_hal_ttyusb.c index d1626dcb0..72f74ab2b 100755 --- a/code/application/source/sf_app/code/source/ttyusb/sf_hal_ttyusb.c +++ b/code/application/source/sf_app/code/source/ttyusb/sf_hal_ttyusb.c @@ -449,7 +449,7 @@ SINT32 sf_hal_ttyusb2_read_buf(SF_TTY_DATA_TYPE_S *recv) } else if (0 == s32ret) { waitTime--; - MLOGW("FIFO select timeout [%d]\n",waitTime); + //MLOGW("FIFO select timeout [%d]\n",waitTime); continue; } } diff --git a/code/lib/include/PBXFileList/PBXFileList.h b/code/lib/include/PBXFileList/PBXFileList.h index d2ba23dac..6d1179df5 100755 --- a/code/lib/include/PBXFileList/PBXFileList.h +++ b/code/lib/include/PBXFileList/PBXFileList.h @@ -78,6 +78,7 @@ typedef enum _PBX_FLIST_CONFIG_ID { PBX_FLIST_CONFIG_SORT_BYSN_DELIMSTR = 0x10, ///< only for FileDB, set the delimiter string, e.g. underline "_", "AA" PBX_FLIST_CONFIG_SORT_BYSN_DELIMNUM = 0x11, ///< only for FileDB, set the delimiter count to find the serial number PBX_FLIST_CONFIG_SORT_BYSN_NUMOFSN = 0x12, ///< only for FileDB, set the character number of the serial number + PBX_FLIST_CONFIG_DCF_HANDLE = 0x13, ///< only for DCF , multi storage DCF handle ENUM_DUMMY4WORD(PBX_FLIST_CONFIG_ID) } PBX_FLIST_CONFIG_ID; diff --git a/code/lib/source/pbxfilelist_dcf/libpbxfilelist_dcf.a b/code/lib/source/pbxfilelist_dcf/libpbxfilelist_dcf.a index 6bff2c316..1747f888c 100644 Binary files a/code/lib/source/pbxfilelist_dcf/libpbxfilelist_dcf.a and b/code/lib/source/pbxfilelist_dcf/libpbxfilelist_dcf.a differ diff --git a/code/lib/source/pbxfilelist_dcf/libpbxfilelist_dcf.so b/code/lib/source/pbxfilelist_dcf/libpbxfilelist_dcf.so index 39bffce39..b6110c43f 100755 Binary files a/code/lib/source/pbxfilelist_dcf/libpbxfilelist_dcf.so and b/code/lib/source/pbxfilelist_dcf/libpbxfilelist_dcf.so differ 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 8623c3b60..668eb0c87 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -289,8 +289,8 @@ void sf_mode_detect(void) } else if(pwroffcnt == 6) { - sf_sys_status_led_set(SF_LED_SYS_STATE_EXIT_GO_TO_PIR); - /* + sf_sys_status_led_set(SF_LED_SYS_STATE_POWER_OFF); + printf("[power off] %s(%d) AutoOfftime:%d\n", __FUNCTION__, __LINE__, AutoOfftime); #define DO_NOT_SHOW_POWER_OFF 0 if(AutoOfftime >= KeepAliveTime_s) @@ -305,7 +305,7 @@ void sf_mode_detect(void) Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); //shutdown start #endif } - sf_set_power_off_flag(1);*/ + sf_set_power_off_flag(1); } } else diff --git a/code/lib/source/sifar/code/source/mcu/sf_mcu_client.c b/code/lib/source/sifar/code/source/mcu/sf_mcu_client.c index 6569e2daa..879629655 100644 --- a/code/lib/source/sifar/code/source/mcu/sf_mcu_client.c +++ b/code/lib/source/sifar/code/source/mcu/sf_mcu_client.c @@ -804,14 +804,7 @@ void sf_mcu_dataready_ck(UINT8 startMode) gModuleSleep = 0; //power off 4G module sf_set_power_off_flag(1); printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__); - if((startMode == 1) && (PWR_ON_AUTO == sf_cardv_convert_power_on_mode())) - { - system("watchdog -T 1 -t 5 /dev/watchdog"); - } - else - { - Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, 0); //shutdown start - } + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, 0); //shutdown start } } 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 fe543acaa..c5978e056 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 "7MR5RCwDC05" +#define SF_BASE_VERSION "7MR5RCwDC07" #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ #define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ #define PHOTO_THUMB_PATH ":\\THUMB\\" @@ -986,6 +986,8 @@ #define ANR_FUNC ENABLE #endif #define SF_NO_SD_SEND ENABLE +#define SF_4G_MODE_TEST DISABLE + ////////////////////sf end//////////////////////////////// diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index 59f1a5eec..45f88dc89 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -198,14 +198,22 @@ #else #define DEFAULT_BOOT_WORK_MODE SF_CAM_MODE_PHOTO// #define DEFAULT_NET_WORK_NEED_SEARCH SF_ON -#define DEFAULT_AUTO_OFF_SWITCH SF_ON #define DEFAULT_PIR_SWITCH SF_ON #define DEFAULT_PIR_SENSITIVITY SF_PIR_SENSITIVITY_7 #define DEFAULT_TIMELAPSE_SWITCH SF_OFF #if SF_BATTERY_TEST == ENABLE #define DEFAULT_GPRS_SWITCH SF_OFF #else +#if SF_4G_MODE_TEST == ENABLE +#define DEFAULT_GPRS_SWITCH SF_OFF +#define DEFAULT_GPRS_MODE SF_REMOTE_CONTROL_REAL_TIME +#define DEFAULT_AUTO_OFF_SWITCH SF_OFF +#else #define DEFAULT_GPRS_SWITCH SF_ON +#define DEFAULT_GPRS_MODE SF_REMOTE_CONTROL_OFF +#define DEFAULT_AUTO_OFF_SWITCH SF_ON +#endif + #endif #endif @@ -217,7 +225,6 @@ #define DEFAULT_SEND_TYPE SF_SEND_TIMELY #define DEFAULT_PIR_DELAY_SWITCH SF_OFF -#define DEFAULT_GPRS_MODE SF_REMOTE_CONTROL_OFF #define DEFAULT_DAILY_REPORT_SWITCH SF_ON #define DEFAULT_GPS_SWITCH SF_ON //#if defined(_MODEL_565_HUNTING_EVB_LINUX_4G_68CS_) diff --git a/rtos/code/driver/na51089/source/mcu/sf_mcu.c b/rtos/code/driver/na51089/source/mcu/sf_mcu.c index 59998b393..b00a28952 100755 --- a/rtos/code/driver/na51089/source/mcu/sf_mcu.c +++ b/rtos/code/driver/na51089/source/mcu/sf_mcu.c @@ -2171,7 +2171,6 @@ void sf_file_thumb_cfg_sava(void) UINT8 fileIndex = 0; INT32 ret_fs = 0; FST_FILE_STATUS FileStat; - char tmp[64] = {'\0'}; UIMenuStoreInfo *puiPara = sf_ui_para_get(); if (pThumbFileCfg != NULL) { @@ -2183,6 +2182,7 @@ void sf_file_thumb_cfg_sava(void) //static int flag = 0; //struct stat st; #if SF_IQ_TEST != ENABLE + char tmp[64] = {'\0'}; INT32 uiStatus = 0; UINT8 ucAttrib = 0; snprintf(tmp, sizeof(tmp), "%c%s", 'A', PHOTO_THUMB_PATH);