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 758e40df8..9dda4649b 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -979,6 +979,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/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/Play/UIAppPlay_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c index 648ccdd11..ee8e118b9 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c @@ -233,7 +233,7 @@ BOOL PBDecVideoCB(UINT32 uiUserDataAddr, UINT32 uiUserDataSize) */ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { - + printf("[------------------------------------------------------------------------------------------------------------------]\n"); UINT32 useFileDB = 0; UINT32 uiPoolAddr = (UINT32)mempool_filedb; @@ -260,7 +260,7 @@ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) if (useFileDB) { CHAR *rootPath = "A:\\"; //CHAR* defaultfolder="A:\\CarDV\\"; - + printf("[---------useFileDB IN -]%d\n", useFileDB); PPBX_FLIST_OBJ pFlist = PBXFList_FDB_getObject(); pFlist->Config(PBX_FLIST_CONFIG_MEM, uiPoolAddr, POOL_SIZE_FILEDB); pFlist->Config(PBX_FLIST_CONFIG_MAX_FILENUM, 5000, 0); @@ -275,6 +275,7 @@ 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 { + printf("[---------useFileDB not in -]%d\n", useFileDB); PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)PBXFList_DCF_getObject()); } PB_SetParam(PBPRMID_DEC_VIDEO_CALLBACK, (UINT32)PBDecVideoCB); 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/UIFlowPhoto/UIFlowPhotoEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c index f9c6c172e..af2ebfe7e 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 @@ -2139,8 +2139,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/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..1cd57d4af 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; +extern SF_ST_MMC_DEV *mmc_dev; +//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: @@ -1369,7 +1436,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 +2336,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 +2350,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..d704db4a4 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,6 +56,7 @@ 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); 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/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/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/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index 8623c3b60..f442bad07 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -289,7 +289,7 @@ 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 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..04237bb41 100755 --- a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -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_)