From b80e0d06a3cdfdd46ffe4fbf5c5772c825f509bf Mon Sep 17 00:00:00 2001 From: iysheng Date: Tue, 29 Mar 2022 20:39:28 +0800 Subject: [PATCH] Optimize macro judgment statements to support ESP8266 and EC600S co-exist --- .../mqttclient_iot_explorer/mqttclient_iot_explorer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/mqttclient_iot_explorer/mqttclient_iot_explorer.c b/examples/mqttclient_iot_explorer/mqttclient_iot_explorer.c index 5ba7988c..859784a5 100644 --- a/examples/mqttclient_iot_explorer/mqttclient_iot_explorer.c +++ b/examples/mqttclient_iot_explorer/mqttclient_iot_explorer.c @@ -5,11 +5,14 @@ #include "sal_module_wrapper.h" #define USE_ESP8266 + //#define USE_EC600S -#if defined(USE_ESP8266) +#ifdef USE_ESP8266 #include "esp8266.h" -#elif defined(USE_EC600S) +#endif + +#ifdef USE_EC600S #include "ec600s.h" #endif @@ -98,7 +101,6 @@ void mqttclient_task(void) esp8266_join_ap("Mculover666", "mculover666"); #endif - #ifdef USE_EC600S ec600s_sal_init(HAL_UART_PORT_2); #endif