V1.007.SJ
1.修复下行网口的MAC获取
2.增加232回显
This commit is contained in:
2026-09-21 11:22:47 +08:00
parent ac9199b926
commit 50de2b5e41
7 changed files with 1669 additions and 1635 deletions
+13
View File
@@ -24,6 +24,7 @@ static void proto_Modbus_Init(void);
static void proto_Modbus_Task(void);
static ModbusErrorCode_e ModbusCommunicationDataWrite(u16 Addr, u16 Value);
static u16 ModbusCommunicationDataRead(u16 Addr);
static void echo_uart_rx(u8 *pData, u16 Len, void *other_data);
proto_Modbus_t Para_Modbus=
{
@@ -54,11 +55,23 @@ static void proto_Modbus_Init(void)
{
COM_Uart1.Rx_DataAnalysis = ModbusCommunicationDataReceive;
COM_Uart2.Rx_DataAnalysis = ModbusCommunicationDataReceive;
COM_Uart3.Rx_DataAnalysis = echo_uart_rx;
}
static void proto_Modbus_Task(void)
{
}
/*232串口的回显*/
static void echo_uart_rx(u8 *pData, u16 Len, void *other_data)
{
bsp_Uart_t *pUart = (bsp_Uart_t*)other_data;
if (!pUart || !pData || Len == 0) return;
// 非 Modbus 数据,原样回显
pUart->Send(pUart, pData, Len);
}
static void ModbusCommunicationDataReceive(u8 *pData, u16 len,void *other_data)
{
ModbusErrorCode_e ErrorCode;