diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 7610d45..49d2d20 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -638,12 +638,12 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) case ' ': // < > StringFormatter::send(stream, F("\n")); return; - +#ifndef DISABLE_DIAG case 'D': // < > if (parseD(stream, params, p)) return; return; - +#endif case '=': // <= Track manager control > if (TrackManager::parseJ(stream, params, p)) return; diff --git a/IODevice.h b/IODevice.h index 769e111..4eb24e5 100644 --- a/IODevice.h +++ b/IODevice.h @@ -29,8 +29,13 @@ // Define symbol IO_NO_HAL to reduce FLASH footprint when HAL features not required // The HAL is disabled by default on Nano and Uno platforms, because of limited flash space. -#if defined(ARDUINO_AVR_NANO) || defined(ARDUINO_AVR_UNO) -#define IO_NO_HAL +#include "defines.h" +#if defined(ARDUINO_AVR_NANO) || defined(ARDUINO_AVR_UNO) + #if defined(DISABLE_DIAG) && defined(DISABLE_EEPROM) && defined(DISABLE_PROG) + #warning you have sacrificed DIAG for HAL + #else + #define IO_NO_HAL + #endif #endif // Define symbol IO_SWITCH_OFF_SERVO to set the PCA9685 output to 0 when an