From 99d7d5355337b08cbfb8974c3a3a08902653ffec Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 12 Jan 2024 13:59:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8F=82=E6=95=B0=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8F=98=E6=9B=B4=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=86=99?= =?UTF-8?q?Flash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) 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 b989bdc86..a9adf9078 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 @@ -336,7 +336,7 @@ static BOOL Check_OTA(VOID) void Load_MenuInfo(void) { #if (PST_FUNC == ENABLE) - #if 0 + #if 0 MODELEXT_HEADER *head = NULL; BININFO *pBinInfo = (BININFO *)Dx_GetModelExtCfg(MODELEXT_TYPE_BIN_INFO, &head); PPSTORE_SECTION_HANDLE pSection; @@ -407,7 +407,7 @@ void Load_MenuInfo(void) UINT32 result; UINT32 uiFWUpdate = 0; UINT32 uiTmpBoot = 0; - + #if 1 //cmdline for ota FILE *fp = NULL; UINT32 u32size = 0; @@ -498,8 +498,7 @@ void Load_MenuInfo(void) #endif #else //for #if (PST_FUNC == ENABLE) - - if(Check_OTA() == TRUE){ + if(Check_OTA() == TRUE){ DBG_DUMP("OTA success, reset system param\n"); // #if HUNTING_CAMERA_MCU == ENABLE @@ -539,7 +538,7 @@ void Load_MenuInfo(void) unsigned long long partition_ofs= 0, partition_size = 0; int ret = -1; UINT32 sectorCnt = 0; - FILE *fd_mmc = NULL; + FILE *fd_mmc = NULL; INT32 rw_len = 0; void *pTempbuf = NULL; @@ -581,10 +580,10 @@ void Load_MenuInfo(void) } #elif defined(_EMBMEM_SPI_NAND_) - + unsigned long long partition_ofs= 0, partition_size = 0; int ret = -1; - FILE *nandump_fp = NULL; + FILE *nandump_fp = NULL; INT32 rw_len = 0; UINT32 sectorCnt = 0; void *tmpInfo = NULL; @@ -711,7 +710,8 @@ EXIT: ret = -1; goto EXIT; } - + printf("[%s:%d]((UIMenuStoreInfo*)tmpInfo)->uhInfoSize=%lu,sizeof(currentInfo)=%lu\n", + __FUNCTION__, __LINE__, ((UIMenuStoreInfo*)tmpInfo)->uhInfoSize, sizeof(currentInfo)); if(((UIMenuStoreInfo*)tmpInfo)->uhInfoSize == sizeof(currentInfo)){ #if HUNTING_CAMERA_MCU == ENABLE @@ -1072,12 +1072,20 @@ EXIT: #if HUNTING_CAMERA_MCU == ENABLE sf_power_on_para_check_init(); #endif - /* check if sys param changed */ - if(memcmp(¤tInfo, &origInfo, sizeof(currentInfo)) == 0){ + + + /* check if sys param changed */ + int sflSize = sizeof(currentInfo) - ((int)¤tInfo.TimelapseTime - (int)¤tInfo); + printf("sizeof(currentInfo)=%d, (int)¤tInfo.TimelapseTime=%d, (int)¤tInfo=%d, sflSize=%d,\n", + sizeof(currentInfo), (int)¤tInfo.TimelapseTime, (int)¤tInfo, sflSize); + + if(memcmp(¤tInfo.TimelapseTime, &origInfo.TimelapseTime, sflSize) == 0) + { + DBG_DUMP("menu info is not changed\n"); goto EXIT; } - + sectorCnt = (sizeof(currentInfo) / _EMBMEM_BLK_SIZE_) + ((sizeof(currentInfo) % _EMBMEM_BLK_SIZE_)? 1 : 0); ret = UIInfo_GetStrgPartitionInfo(&partition_ofs, &partition_size, PARTITION_PATH_SYS); @@ -2402,4 +2410,4 @@ void sf_power_on_para_check_init(void) sf_set_pir_sensitivity(puiPara->PirSensitivity); #endif #endif -} \ No newline at end of file +}