From 5ec1a1863215754246bbc87becf1184935d4c466 Mon Sep 17 00:00:00 2001 From: YuanHongbin <975559679@qq.com> Date: Thu, 6 Aug 2026 18:09:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(rtc):=20=E4=BF=AE=E6=AD=A3RTC=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=97=B6=E5=8C=BA=E5=81=8F=E7=A7=BB+8=E5=B0=8F?= =?UTF-8?q?=E6=97=B6(=E5=8C=97=E4=BA=AC=E6=97=B6=E9=97=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TimeSync去除localtime时区转换 - GateWayInit启动时区偏移校正 --- Project/GateWay/MDK/GateWay.uvoptx | 19 ++++++++++++++++++- Project/GateWay/MDK/RTE/RTOS/board.c | 23 +++++++++++------------ Project/GateWay/source/User/Inc/main.h | 2 +- Project/GateWay/source/User/Src/bsp.c | 2 +- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Project/GateWay/MDK/GateWay.uvoptx b/Project/GateWay/MDK/GateWay.uvoptx index 61c1a8e..27b7bf9 100644 --- a/Project/GateWay/MDK/GateWay.uvoptx +++ b/Project/GateWay/MDK/GateWay.uvoptx @@ -428,7 +428,24 @@ - + + + 0 + 0 + 569 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\source\User\Src\CatOneTask.c + + +
+
0 diff --git a/Project/GateWay/MDK/RTE/RTOS/board.c b/Project/GateWay/MDK/RTE/RTOS/board.c index 8f65c3f..9bbfa65 100644 --- a/Project/GateWay/MDK/RTE/RTOS/board.c +++ b/Project/GateWay/MDK/RTE/RTOS/board.c @@ -77,8 +77,8 @@ void rt_hw_board_init(void) static int uart_init(void) { //#error "TODO 2: Enable the hardware uart and config baudrate." - //DbgOrCat1Uart_Config(500000); - RS485Ch1_Config(500000); + DbgOrCat1Uart_Config(500000); +// RS485Ch1_Config(500000); return 0; } INIT_BOARD_EXPORT(uart_init); @@ -86,16 +86,15 @@ INIT_BOARD_EXPORT(uart_init); void rt_hw_console_output(const char *str) { rt_enter_critical(); - RS485Ch1UartSend((uint8_t *)str, strlen(str)); -// switch(GateWay.ConfigPara.Duch) { -// case CH_RS485_1: RS485Ch1UartSend((uint8_t *)str, strlen(str)); break; -// case CH_RS485_2: RS485Ch2UartSend((uint8_t *)str, strlen(str)); break; -// case CH_ETH: EthUartSend((uint8_t *)str, strlen(str)); break; -// case CH_LORA: Sx1276LoRaSendBuffer((uint8_t *)str, strlen(str)); break; -// case CH_CAT1: DebugOrCat1UartSend((uint8_t *)str, strlen(str)); break; -// case CH_DBG: DebugOrCat1UartSend((uint8_t *)str, strlen(str)); break; -// default: DebugOrCat1UartSend((uint8_t *)str, strlen(str)); break; -// } + switch(GateWay.ConfigPara.Duch) { + case CH_RS485_1: RS485Ch1UartSend((uint8_t *)str, strlen(str)); break; + case CH_RS485_2: RS485Ch2UartSend((uint8_t *)str, strlen(str)); break; + case CH_ETH: EthUartSend((uint8_t *)str, strlen(str)); break; + case CH_LORA: Sx1276LoRaSendBuffer((uint8_t *)str, strlen(str)); break; + case CH_CAT1: DebugOrCat1UartSend((uint8_t *)str, strlen(str)); break; + case CH_DBG: DebugOrCat1UartSend((uint8_t *)str, strlen(str)); break; + default: DebugOrCat1UartSend((uint8_t *)str, strlen(str)); break; + } rt_exit_critical(); } diff --git a/Project/GateWay/source/User/Inc/main.h b/Project/GateWay/source/User/Inc/main.h index e5a4f54..c0f4740 100644 --- a/Project/GateWay/source/User/Inc/main.h +++ b/Project/GateWay/source/User/Inc/main.h @@ -4,7 +4,7 @@ #include "Public.h" #include "DebugCmd.h" -#define MAC_ADDR_TYPE 3//0为测试服务器 +#define MAC_ADDR_TYPE 0//0为测试服务器 extern bool MainDispEn; #define MAIN_DBG_LOG(...) { if(MainDispEn) Debug_Printf(__VA_ARGS__);} diff --git a/Project/GateWay/source/User/Src/bsp.c b/Project/GateWay/source/User/Src/bsp.c index 67019bb..d5a09aa 100644 --- a/Project/GateWay/source/User/Src/bsp.c +++ b/Project/GateWay/source/User/Src/bsp.c @@ -1512,7 +1512,7 @@ void TimeSync(time_t ts) RtcDateTime.u8Month = td->tm_mon + 1; RtcDateTime.u8Day = td->tm_mday; RtcDateTime.u8Weekday = td->tm_wday; - RtcDateTime.u8Hour = td->tm_hour; + RtcDateTime.u8Hour = td->tm_hour + 8; RtcDateTime.u8Minute = td->tm_min; RtcDateTime.u8Second = td->tm_sec;