From 8fc1470e4ef2eb5c5cdef2e790f041055160369c Mon Sep 17 00:00:00 2001 From: Gregor Baues Date: Sun, 25 Apr 2021 21:59:39 +0200 Subject: [PATCH] Conditional compile for MQTT --- defines.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/defines.h b/defines.h index 961837d..3bf314f 100644 --- a/defines.h +++ b/defines.h @@ -33,13 +33,20 @@ #endif #if ENABLE_ETHERNET && (defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_SAMD_ZERO) || defined(TEENSYDUINO)) -#define ETHERNET_ON true + #define ETHERNET_ON true #else -#define ETHERNET_ON false + #define ETHERNET_ON false #endif +// MQTT is on only if the ethernet is enabled +#if ENABLE_MQTT && ETHERNET_ON + #define MQTT_ON +#else + #warning MQTT requires Ethernet to be enabled. +#endif + // #if WIFI_ON && ETHERNET_ON -// #error Command Station does not support WIFI and ETHERNET at the same time. +// #error Command Station does not support WIFI and ETHERNET at the same time. // #endif ////////////////////////////////////////////////////////////////////////////////