+freertos

но надо еще коменты подправить
This commit is contained in:
2025-08-31 13:24:11 +03:00
parent 1c4f4d689a
commit ef623e8b0b
5 changed files with 126 additions and 67 deletions

View File

@@ -87,15 +87,16 @@ void MODBUS_FirstInit(void)
{
MB_DevoceInentificationInit();
//-----------SETUP MODBUS-------------
// set up modbus: MB_RX_Size_NotConst and Timeout enable
hmodbus1.ID = MODBUS_DEVICE_ID;
hmodbus1.sRS_Timeout = MODBUS_TIMEOUT;
hmodbus1.sRS_Mode = SLAVE_ALWAYS_WAIT;
hmodbus1.sRS_RX_Size_Mode = RS_RX_Size_NotConst;
hmodbus1.pMessagePtr = &MODBUS_MSG;
hmodbus1.rx_pin = MODBUS_RX_PIN;
hmodbus1.tx_pin = MODBUS_TX_PIN;
hmodbus1.taskDelay = RS_IN_FREERTOS;
// INIT
rs_huart.begin(115200, SERIAL_8N1, 8, 9);
hmodbus1.RS_STATUS = RS_Init(&hmodbus1, &rs_huart, 0);
hmodbus1.RS_STATUS = RS_Init(&hmodbus1, &rs_huart, MODBUS_SPEED, 0);
RS_EnableReceive();
}