mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-25 05:31:24 +01:00
move errorStrings
This commit is contained in:
parent
75a00f776a
commit
68a44037c5
@ -505,7 +505,6 @@ Modbus::Modbus(uint8_t busNo, HardwareSerial serial, unsigned long baud, uint16_
|
|||||||
// Add bus to CMRIbus chain.
|
// Add bus to CMRIbus chain.
|
||||||
_nextBus = _busList;
|
_nextBus = _busList;
|
||||||
_busList = this;
|
_busList = this;
|
||||||
const char* errorStrings[] = {"success", "invalid id", "invalid buffer", "invalid quantity", "response timeout", "frame error", "crc error", "unknown comm error", "unexpected id", "exception response", "unexpected function code", "unexpected response length", "unexpected byte count", "unexpected address", "unexpected value", "unexpected quantity"};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -524,7 +523,7 @@ void Modbus::_loop(unsigned long currentMicros) {
|
|||||||
}
|
}
|
||||||
_cycleStartTime = _currentMicros;
|
_cycleStartTime = _currentMicros;
|
||||||
if (_currentNode == NULL) return;
|
if (_currentNode == NULL) return;
|
||||||
|
const char* errorStrings[] = {"success", "invalid id", "invalid buffer", "invalid quantity", "response timeout", "frame error", "crc error", "unknown comm error", "unexpected id", "exception response", "unexpected function code", "unexpected response length", "unexpected byte count", "unexpected address", "unexpected value", "unexpected quantity"};
|
||||||
uint8_t error;
|
uint8_t error;
|
||||||
error = modbusmaster->writeMultipleHoldingRegisters(_currentNode->getNodeID(), 0, _currentNode->holdingRegisters, _currentNode->getNumHoldingRegisters());
|
error = modbusmaster->writeMultipleHoldingRegisters(_currentNode->getNodeID(), 0, _currentNode->holdingRegisters, _currentNode->getNumHoldingRegisters());
|
||||||
if (error != 0) DIAG(F("ModbusHR: %02d %04d %04d %s"), _currentNode->getNodeID(), 0, _currentNode->getNumHoldingRegisters(), &errorStrings[error]);
|
if (error != 0) DIAG(F("ModbusHR: %02d %04d %04d %s"), _currentNode->getNodeID(), 0, _currentNode->getNumHoldingRegisters(), &errorStrings[error]);
|
||||||
|
Loading…
Reference in New Issue
Block a user