diff --git a/code/espurna/config/all.h b/code/espurna/config/all.h index 9aca96a8..03d55c92 100644 --- a/code/espurna/config/all.h +++ b/code/espurna/config/all.h @@ -30,11 +30,11 @@ #include "defaults.h" #include "general.h" #include "dependencies.h" +#include "debug.h" #include "prototypes.h" #include "sensors.h" #include "webui.h" #include "progmem.h" -#include "debug.h" #ifdef USE_CORE_VERSION_H #include "core_version.h" diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index 7e25eb04..d46d97c4 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -725,12 +725,6 @@ #if SENSOR_SUPPORT -#if SENSOR_DEBUG - #include "../config/debug.h" -#endif - -#include "../sensors/BaseSensor.h" - #if AM2320_SUPPORT #include "../sensors/AM2320Sensor.h" #endif @@ -748,12 +742,10 @@ #endif #if CSE7766_SUPPORT - #include #include "../sensors/CSE7766Sensor.h" #endif #if DALLAS_SUPPORT - #include #include "../sensors/DallasSensor.h" #endif @@ -786,7 +778,7 @@ #endif #if GEIGER_SUPPORT - #include "../sensors/GeigerSensor.h" // The main file for geiger counting module + #include "../sensors/GeigerSensor.h" #endif #if GUVAS12SD_SUPPORT @@ -794,37 +786,30 @@ #endif #if HLW8012_SUPPORT - #include #include "../sensors/HLW8012Sensor.h" #endif #if MHZ19_SUPPORT - #include #include "../sensors/MHZ19Sensor.h" #endif #if NTC_SUPPORT - #include "../sensors/AnalogSensor.h" #include "../sensors/NTCSensor.h" #endif #if SDS011_SUPPORT - #include #include "../sensors/SDS011Sensor.h" #endif #if SENSEAIR_SUPPORT - #include #include "../sensors/SenseAirSensor.h" #endif #if PMSX003_SUPPORT - #include #include "../sensors/PMSX003Sensor.h" #endif #if PZEM004T_SUPPORT - #include #include "../sensors/PZEM004TSensor.h" #endif @@ -845,7 +830,6 @@ #endif #if V9261F_SUPPORT - #include #include "../sensors/V9261FSensor.h" #endif diff --git a/code/espurna/influxdb.ino b/code/espurna/influxdb.ino index 4d6e7f07..67bc4d96 100644 --- a/code/espurna/influxdb.ino +++ b/code/espurna/influxdb.ino @@ -51,7 +51,7 @@ bool idbSend(const char * topic, const char * payload) { #endif char * host = strdup(h.c_str()); unsigned int port = getSetting("idbPort", INFLUXDB_PORT).toInt(); - DEBUG_MSG("[INFLUXDB] Sending to %s:%u\n", host, port); + DEBUG_MSG_P(PSTR("[INFLUXDB] Sending to %s:%u\n"), host, port); bool success = false; @@ -60,7 +60,7 @@ bool idbSend(const char * topic, const char * payload) { char data[128]; snprintf(data, sizeof(data), "%s,device=%s value=%s", topic, getSetting("hostname").c_str(), String(payload).c_str()); - DEBUG_MSG("[INFLUXDB] Data: %s\n", data); + DEBUG_MSG_P(PSTR("[INFLUXDB] Data: %s\n"), data); char request[256]; snprintf(request, sizeof(request), "POST /write?db=%s&u=%s&p=%s HTTP/1.1\r\nHost: %s:%u\r\nContent-Length: %d\r\n\r\n%s", @@ -74,14 +74,14 @@ bool idbSend(const char * topic, const char * payload) { if (_idb_client.connected()) _idb_client.stop(); success = true; } else { - DEBUG_MSG("[INFLUXDB] Sent failed\n"); + DEBUG_MSG_P(PSTR("[INFLUXDB] Sent failed\n")); } _idb_client.stop(); while (_idb_client.connected()) yield(); } else { - DEBUG_MSG("[INFLUXDB] Connection failed\n"); + DEBUG_MSG_P(PSTR("[INFLUXDB] Connection failed\n")); } free(host); diff --git a/code/espurna/ir.ino b/code/espurna/ir.ino index b43d93fe..a61c8fc3 100644 --- a/code/espurna/ir.ino +++ b/code/espurna/ir.ino @@ -174,11 +174,11 @@ void _irMqttCallback(unsigned int type, const char * topic, const char * payload DEBUG_MSG_P(PSTR("[IR] Raw IR output %d codes, repeat %d times on %d(k)Hz freq.\n"), count, _ir_repeat, _ir_freq); /* - DEBUG_MSG("[IR] main codes: "); + DEBUG_MSG_P(PSTR("[IR] main codes: ")); for(int i = 0; i < count; i++) { - DEBUG_MSG("%d,",_ir_raw[i]); + DEBUG_MSG_P(PSTR("%d,"),_ir_raw[i]); } - DEBUG_MSG("\n"); + DEBUG_MSG_P(PSTR("\n")); */ #if defined(IR_RX_PIN) diff --git a/code/espurna/sensors/SI7021Sensor.h b/code/espurna/sensors/SI7021Sensor.h index 9e778aaa..3316e726 100644 --- a/code/espurna/sensors/SI7021Sensor.h +++ b/code/espurna/sensors/SI7021Sensor.h @@ -10,8 +10,6 @@ #undef I2C_SUPPORT #define I2C_SUPPORT 1 // Explicitly request I2C support. - - #include "Arduino.h" #include "I2CSensor.h"