1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 13:21:23 +01:00

IO_Modbus: board support limits

This commit is contained in:
travis-farmer 2024-12-01 12:26:12 -05:00
parent f47e417c8f
commit 8137423325
No known key found for this signature in database
GPG Key ID: 0BC296791D14CB35
2 changed files with 8 additions and 3 deletions

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>.
*/
#if defined(MBEXPERIMENTAL) || defined(ARDUINO_ARCH_STM32)
#include "IO_Modbus.h"
#include "defines.h"
void ModbusADU::setTransactionId(uint16_t transactionId) {
@ -504,6 +504,8 @@ Modbus::Modbus(uint8_t busNo, HardwareSerial &serial, unsigned long baud, uint16
_cycleTime = cycleTimeMS * 1000UL; // convert from milliseconds to microseconds.
_waitA = waitA;
_waitB = waitB;
if (_waitA < 3) _waitA = 3;
if (_waitB < 2) _waitB = 2;
// Add device to HAL device chain
IODevice::addDevice(this);
@ -643,3 +645,4 @@ Modbusnode::Modbusnode(VPIN firstVpin, int nPins, uint8_t busNo, uint8_t nodeID,
}
}
#endif

View File

@ -50,7 +50,7 @@
#ifndef IO_MODBUS_H
#define IO_MODBUS_H
#if defined(MBEXPERIMENTAL) || defined(ARDUINO_ARCH_STM32)
#include "IODevice.h"
class ModbusADU {
public:
@ -406,5 +406,7 @@ public:
return NULL;
}
};
#else
#error "You have included IO_Modbus on an unsupported board!"
#endif
#endif // IO_MODBUS_H