From 70758b1c06d6ff136106b15e0f317bd1f9d9a0d6 Mon Sep 17 00:00:00 2001 From: YuanHongbin <975559679@qq.com> Date: Tue, 14 Jul 2026 18:16:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=A1=E6=9F=A5?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E7=9A=844=E4=B8=AA=E9=AB=98=E5=8D=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. UartDebug: RS485通道1关闭指令误操作通道2,修正'u'升降级通道混淆 2. bsp: GPIOInit新增PA3(ADC电源控制引脚)初始化为输出 3. main.h: Nonce从int16_t改为uint16_t,消除rand()溢出导致LPTimer0延时异常 4. SGCP: SUB_STATUS_BROADCAST_SYNC_TIME调用ToSDSetColTime改为ToSDSyncTime --- Module/LaserTracing_Debug/UartDebug.c | 6 +++--- source/inc/main.h | 2 +- source/src/SGCP.c | 2 +- source/src/bsp.c | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Module/LaserTracing_Debug/UartDebug.c b/Module/LaserTracing_Debug/UartDebug.c index 7f0ca2b..7143afc 100644 --- a/Module/LaserTracing_Debug/UartDebug.c +++ b/Module/LaserTracing_Debug/UartDebug.c @@ -436,7 +436,7 @@ void DebugCmdRS485Ctrl(int argc, char *argv[]) } else if(strstr(argv[3], "off") != NULL){ if(idx == 1) - App.Para.Rs485Ch2.Enable = false; + App.Para.Rs485Ch1.Enable = false; else if(idx == 2) App.Para.Rs485Ch2.Enable = false; DBG_LOG("RS485Ch%d Disable!\r\n", idx); @@ -519,11 +519,11 @@ void DebugCmdRS485Ctrl(int argc, char *argv[]) DBG_LOG("At least keep one upgraded serial port!\r\n"); return; } - App.Para.Rs485Ch2.UpgradeEnable = false; + App.Para.Rs485Ch1.UpgradeEnable = false; DBG_LOG("RS485Ch%d Upgrade Off!\r\n", idx); } else if(idx == 2) { - if(App.Para.Rs485Ch2.UpgradeEnable == false) + if(App.Para.Rs485Ch1.UpgradeEnable == false) { DBG_LOG("At least keep one upgraded serial port!\r\n"); return; diff --git a/source/inc/main.h b/source/inc/main.h index 74de791..fc2176d 100644 --- a/source/inc/main.h +++ b/source/inc/main.h @@ -100,7 +100,7 @@ typedef struct { bool CaliFlag; //У־λ - int16_t Nonce; // + uint16_t Nonce; // }AppDetect_t; extern AppDetect_t App; diff --git a/source/src/SGCP.c b/source/src/SGCP.c index d145636..e342265 100644 --- a/source/src/SGCP.c +++ b/source/src/SGCP.c @@ -1355,7 +1355,7 @@ void SubRevLoopHandler(void) break;} case SUB_STATUS_BROADCAST_SYNC_TIME:{ - ToSDSetColTime(0x00, App.Para.Layout.TimeStamp); + ToSDSyncTime(0x00, App.Para.Layout.TimeStamp); SGCP.SubStatus = SUB_STATUS_IDLE; break;} } diff --git a/source/src/bsp.c b/source/src/bsp.c index 2175306..60cf0a3 100644 --- a/source/src/bsp.c +++ b/source/src/bsp.c @@ -390,6 +390,8 @@ static void GPIOInit(void) Gpio_Init(LASER1_ON_OFF_PORTx,LASER1_ON_OFF_PINx,&GpioInitStruct); Gpio_Init(LASER2_ON_OFF_PORTx,LASER2_ON_OFF_PINx,&GpioInitStruct); Gpio_Init(LASER3_ON_OFF_PORTx,LASER3_ON_OFF_PINx,&GpioInitStruct); + //< ADC??????? + Gpio_Init(AD_ON_OFF_PORTx,AD_ON_OFF_PINx,&GpioInitStruct); GpioInitStruct.bOutputVal = true; ///< ˿Ĭ->ߵƽ //< LORA --> RST