mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-24 21:21:24 +01:00
IO_Modbus: board support limits
This commit is contained in:
parent
f47e417c8f
commit
8137423325
@ -16,7 +16,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>.
|
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
#if defined(MBEXPERIMENTAL) || defined(ARDUINO_ARCH_STM32)
|
||||||
#include "IO_Modbus.h"
|
#include "IO_Modbus.h"
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
void ModbusADU::setTransactionId(uint16_t transactionId) {
|
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.
|
_cycleTime = cycleTimeMS * 1000UL; // convert from milliseconds to microseconds.
|
||||||
_waitA = waitA;
|
_waitA = waitA;
|
||||||
_waitB = waitB;
|
_waitB = waitB;
|
||||||
|
if (_waitA < 3) _waitA = 3;
|
||||||
|
if (_waitB < 2) _waitB = 2;
|
||||||
// Add device to HAL device chain
|
// Add device to HAL device chain
|
||||||
IODevice::addDevice(this);
|
IODevice::addDevice(this);
|
||||||
|
|
||||||
@ -643,3 +645,4 @@ Modbusnode::Modbusnode(VPIN firstVpin, int nPins, uint8_t busNo, uint8_t nodeID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
#ifndef IO_MODBUS_H
|
#ifndef IO_MODBUS_H
|
||||||
#define IO_MODBUS_H
|
#define IO_MODBUS_H
|
||||||
|
#if defined(MBEXPERIMENTAL) || defined(ARDUINO_ARCH_STM32)
|
||||||
#include "IODevice.h"
|
#include "IODevice.h"
|
||||||
class ModbusADU {
|
class ModbusADU {
|
||||||
public:
|
public:
|
||||||
@ -406,5 +406,7 @@ public:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
#error "You have included IO_Modbus on an unsupported board!"
|
||||||
|
#endif
|
||||||
#endif // IO_MODBUS_H
|
#endif // IO_MODBUS_H
|
||||||
|
Loading…
Reference in New Issue
Block a user