Add ifdef to Modbus server error message printing

This commit is contained in:
Daniel Öster 2024-10-27 21:22:41 +02:00
parent b8cb5fede6
commit d67e9dcf99

View file

@ -256,7 +256,9 @@ void ModbusServerRTU::serve(ModbusServerRTU *myServer) {
if (request[0] != TIMEOUT) { if (request[0] != TIMEOUT) {
// Any other error could be important for debugging, so print it // Any other error could be important for debugging, so print it
ModbusError me((Error)request[0]); ModbusError me((Error)request[0]);
#ifdef DEBUG_VIA_USB
LOG_E("RTU receive: %02X - %s\n", (int)me, (const char *)me); LOG_E("RTU receive: %02X - %s\n", (int)me, (const char *)me);
#endif //DEBUG_VIA_USB
} }
} }
// Give scheduler room to breathe // Give scheduler room to breathe