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

move errorStrings

This commit is contained in:
travis-farmer 2024-11-25 05:28:49 -05:00
parent 75a00f776a
commit 68a44037c5
No known key found for this signature in database
GPG Key ID: 0BC296791D14CB35

View File

@ -505,7 +505,6 @@ Modbus::Modbus(uint8_t busNo, HardwareSerial serial, unsigned long baud, uint16_
// Add bus to CMRIbus chain.
_nextBus = _busList;
_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;
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;
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]);