From dc82bcc18e5daecd2d199e9500276bc805214181 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 18 Aug 2023 16:48:46 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E5=8F=8A=E6=97=B6=E5=85=B3=E6=9C=BA=EF=BC=9B=202.=E6=9B=B4?= =?UTF-8?q?=E6=AD=A3=E5=8D=A1=E6=BB=A1=E6=97=B6led=E4=BA=AE=E7=81=AF?= =?UTF-8?q?=EF=BC=9B=203.=E8=B0=83=E7=94=A8=E7=B3=BB=E7=BB=9Fsync,?= =?UTF-8?q?=E4=BB=A5=E5=85=8D=E4=B8=A2=E5=A4=B1=E6=95=B0=E6=8D=AE=EF=BC=9B?= =?UTF-8?q?=204.=E8=B0=83=E6=95=B4led=E6=97=B6=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/app/sf_app.c | 2 +- .../source/sf_app/code/source/app/sf_common.c | 4 ++-- .../source/sf_app/code/source/app/sf_system.c | 10 +++++----- .../sf_app/code/source/devMng/sf_ledmng.c | 19 +++++++++---------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/code/application/source/sf_app/code/source/app/sf_app.c b/code/application/source/sf_app/code/source/app/sf_app.c index 1c3061591..889684e71 100755 --- a/code/application/source/sf_app/code/source/app/sf_app.c +++ b/code/application/source/sf_app/code/source/app/sf_app.c @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) printf("[%s:%d] isUsb = %d isCard = %d isUpdate:%d CamMode:%d startup:%d %s\n", __FUNCTION__, __LINE__, isUsb,isCard,isUpdate,puiPara->CamMode, startup, sf_poweron_type_string(startup)); sf_led_init(); - if((!isUsb) && (SF_MCU_STARTUP_NORMAL != startup) /*&& (0 == isUpdate)*/) + if((!isUsb) && (SF_MCU_STARTUP_NORMAL != startup) && (SF_MCU_STARTUP_OFF != startup)/*&& (0 == isUpdate)*/) { #if SF_IQ_TEST != ENABLE if((0 == isUpdate)) diff --git a/code/application/source/sf_app/code/source/app/sf_common.c b/code/application/source/sf_app/code/source/app/sf_common.c index b00cb4207..b60b6c69d 100755 --- a/code/application/source/sf_app/code/source/app/sf_common.c +++ b/code/application/source/sf_app/code/source/app/sf_common.c @@ -580,11 +580,11 @@ static SINT32 sf_app_process_cmd_SD(SF_MESSAGE_BUF_S *pMessageBuf) printf("SD free=%dM/%dM\n", storeattrs.SDFree, storeattrs.SDTotalSize); if (storeattrs.SDFree < 30) /* 30MB */ { - sf_sys_status_led_set(SF_LED_SYS_STATE_SD_NORMAL); + sf_sys_status_led_set(SF_LED_SYS_STATE_SD_FULL); } else { - sf_sys_status_led_set(SF_LED_SYS_STATE_SD_FULL); + sf_sys_status_led_set(SF_LED_SYS_STATE_SD_NORMAL); } sf_statistics_param_load(sf_statistics_param_get()); MLOGI("card-%d mount OK\r\n", pMessageBuf->arg2 + 1); diff --git a/code/application/source/sf_app/code/source/app/sf_system.c b/code/application/source/sf_app/code/source/app/sf_system.c index aebb49ea8..1daa1b977 100755 --- a/code/application/source/sf_app/code/source/app/sf_system.c +++ b/code/application/source/sf_app/code/source/app/sf_system.c @@ -682,13 +682,13 @@ SINT32 app_system_poweroff(SF_POWEROFF_TYPE_E enType ) //if((puiPara->DebugMode) || (puiPara->QLogSwitch)){ // sync(); //} - if(SF_MCU_STARTUP_ONKEY != sf_poweron_type_get()) - sync(); + //if(SF_MCU_STARTUP_ONKEY != sf_poweron_type_get()) + system("sync"); //MLOGD("s\n"); sf_mcu_reg_set(SF_MCU_POWEROFF,sf_poweroff_type_get()); - if(SF_MCU_STARTUP_ONKEY != sf_poweron_type_get()) - sync(); + //if(SF_MCU_STARTUP_ONKEY != sf_poweron_type_get()) + system("sync"); /* SF_STORE_ATTR_S storeattrs = {0}; SF_STARTUP_TYPE_E startup = SF_MCU_STARTUP_ONKEY; @@ -738,7 +738,7 @@ SINT32 app_system_poweroff(SF_POWEROFF_TYPE_E enType ) sf_sys_poweroff(sf_poweroff_type_get()); */ - return SF_SUCCESS; + return SF_SUCCESS; } SINT32 app_http_time_by_timezone_set(void) { diff --git a/code/application/source/sf_app/code/source/devMng/sf_ledmng.c b/code/application/source/sf_app/code/source/devMng/sf_ledmng.c index 1240279ba..22268ff59 100755 --- a/code/application/source/sf_app/code/source/devMng/sf_ledmng.c +++ b/code/application/source/sf_app/code/source/devMng/sf_ledmng.c @@ -395,7 +395,6 @@ void* sf_led_thread(void *arg) printf("[%s:%d] s\n", __FUNCTION__, __LINE__); while(isLedExit) { - for(i = 0; i < SF_LED_ALL; i++) { if(isUsbIn) @@ -423,11 +422,11 @@ void* sf_led_thread(void *arg) { sf_led_off(LedInfo[i].ledId); } - else if(LedInfo[i].times == 50) //50*10ms + else if(LedInfo[i].times == 10) //10*50ms { sf_led_on(LedInfo[i].ledId); } - else if(LedInfo[i].times == 100) //100*10ms + else if(LedInfo[i].times == 20) //20*50ms { sf_led_off(LedInfo[i].ledId); LedInfo[i].times = 0; @@ -466,11 +465,11 @@ void* sf_led_thread(void *arg) { sf_led_off(LedInfo[i].ledId); } - else if(LedInfo[i].times == 25) //50*10ms + else if(LedInfo[i].times == 10) //10*50ms { sf_led_on(LedInfo[i].ledId); } - else if(LedInfo[i].times == 50) //100*10ms + else if(LedInfo[i].times == 20) //20*50ms { sf_led_off(LedInfo[i].ledId); LedInfo[i].times = 0; @@ -493,11 +492,11 @@ void* sf_led_thread(void *arg) { sf_led_on(LedInfo[i].ledId); } - else if(LedInfo[i].times == 50) //50*10ms + else if(LedInfo[i].times == 10) //10*50ms { sf_led_off(LedInfo[i].ledId); } - else if(LedInfo[i].times == 100) //100*10ms + else if(LedInfo[i].times == 20) //20*50ms { sf_led_on(LedInfo[i].ledId); LedInfo[i].times = 0; @@ -510,11 +509,11 @@ void* sf_led_thread(void *arg) { sf_led_on(LedInfo[i].ledId); } - else if(LedInfo[i].times == 25) //25*10ms + else if(LedInfo[i].times == 5) //5*50ms { sf_led_off(LedInfo[i].ledId); } - else if(LedInfo[i].times == 50) //50*10ms + else if(LedInfo[i].times == 10) //10*50ms { sf_led_on(LedInfo[i].ledId); LedInfo[i].times = 0; @@ -523,7 +522,7 @@ void* sf_led_thread(void *arg) } #endif } - sf_sleep_ms(10); + sf_sleep_ms(40); } printf("[%s:%d] e \n", __FUNCTION__, __LINE__);