update:
V1.007.SJ 1.修复下行网口的MAC获取 2.增加232回显
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@
|
||||
#include "proto_modbus_tcp_master.h"
|
||||
|
||||
const char *HwVersion = "V2.2";
|
||||
char SwVersion[24] = "SECS2 V2.2-V1.006.SJ";
|
||||
char SwVersion[24] = "SECS2 V2.2-V1.007.SJ";
|
||||
void TASK_Idle(void);
|
||||
void Task_10ms(void);
|
||||
void Task_50ms(void);
|
||||
|
||||
@@ -502,8 +502,8 @@ static void W5500_Init(void)
|
||||
//使用单片机UID
|
||||
|
||||
uid[0] = *(u32*)(STM32F1_UID_BASE);
|
||||
uid[1] = *(u32*)(STM32F1_UID_BASE + 4 +1);
|
||||
uid[2] = *(u32*)(STM32F1_UID_BASE + 8 +1);
|
||||
uid[1] = (*(u32*)(STM32F1_UID_BASE + 4) +1);
|
||||
uid[2] = (*(u32*)(STM32F1_UID_BASE + 8) +1);
|
||||
|
||||
|
||||
pW5500_1->Phy_Addr[0] = uid[1] >> 8;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user