From e33aefe84e2ba4745fc162ea396ae14b0b11e40f Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 11 Jan 2024 13:53:23 +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?=E6=A8=A1=E5=9D=97=E9=87=8D=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/app/sf_service.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index 473385bd5..5604c330e 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -90,7 +90,7 @@ SINT32 app_ttyusb_IsOpen(void) { MLOGD("ttyUSB has not been init, will init ttyUSB!\n"); UINT8 i = 0; - + RETRY: for (i = 0; i < 150; i++) { if (access("/dev/ttyUSB2", F_OK) == SF_SUCCESS) { printf("tty usb ko exist!\r\n"); @@ -111,9 +111,12 @@ SINT32 app_ttyusb_IsOpen(void) { if ((0 == retryFlag) && (retryTime >= 100) && (retryTime % 100 == 0)) // 200ms*100 = 20s { - MLOGE("-------ttyUSB init fail, clos usb mux.\n"); - sf_ttyusb_restart(); + MLOGE("-------ttyUSB init fail, reset module.\n"); + sf_mcu_reg_set(SF_MCU_RESET_MODULE, 0); + sleep(5); retryFlag = 1; + retryTime = 0; + goto RETRY; } else if ((1 == retryFlag) && (retryTime >= 50) && (retryTime % 50 == 0)) // 200ms*25 = 5s {