From a546ac2f4a0d98e2cf7a1e516df8091f40976d52 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Sat, 1 May 2021 04:24:13 +0200 Subject: [PATCH] Cleanup headers --- src/hasp/hasp.cpp | 9 ++++----- src/hasp_config.cpp | 5 +++-- src/hasp_config.h | 3 +-- src/hasp_debug.cpp | 5 +---- src/hasp_gui.h | 3 +-- src/hasplib.h | 4 ++++ src/sys/svc/hasp_http.cpp | 14 ++++---------- src/sys/svc/hasp_slave.cpp | 5 +---- src/sys/svc/hasp_telnet.cpp | 3 +-- src/sys/svc/hasp_telnet.h | 3 +-- 10 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/hasp/hasp.cpp b/src/hasp/hasp.cpp index 59b1d366..226d9383 100644 --- a/src/hasp/hasp.cpp +++ b/src/hasp/hasp.cpp @@ -1,6 +1,10 @@ /* MIT License - Copyright (c) 2019-2021 Francis Van Roie For full license information read the LICENSE file in the project folder */ +#include "hasplib.h" +#include "lv_theme_hasp.h" +#include "dev/device.h" + #ifdef ARDUINO #include "ArduinoLog.h" #endif @@ -15,9 +19,6 @@ #include "StreamUtils.h" // For EEPromStream #endif -#include "hasplib.h" -#include "lv_theme_hasp.h" - #if HASP_USE_DEBUG > 0 #include "../hasp_debug.h" #endif @@ -29,8 +30,6 @@ //#include "hasp_filesystem.h" included in hasp_conf.h #endif -#include "dev/device.h" - #if HASP_USE_EEPROM > 0 #include "EEPROM.h" #endif diff --git a/src/hasp_config.cpp b/src/hasp_config.cpp index 4ab9a5e7..cfdf9482 100644 --- a/src/hasp_config.cpp +++ b/src/hasp_config.cpp @@ -3,13 +3,12 @@ #if HASP_USE_CONFIG > 0 -#include "StreamUtils.h" // For EEPromStream - #include "hasplib.h" #include "hasp_config.h" #include "hasp_debug.h" #include "hasp_gui.h" +#include "hal/hasp_hal.h" //#include "hasp_ota.h" included in conf //#include "hasp_filesystem.h" included in conf @@ -22,6 +21,8 @@ #include "EEPROM.h" #endif +#include "StreamUtils.h" // For EEPromStream + extern uint16_t dispatchTelePeriod; extern uint32_t dispatchLastMillis; diff --git a/src/hasp_config.h b/src/hasp_config.h index 65cafbe0..3ab61d58 100644 --- a/src/hasp_config.h +++ b/src/hasp_config.h @@ -6,8 +6,7 @@ #ifndef HASP_CONFIG_H #define HASP_CONFIG_H -#include "hasp_conf.h" -#include "ArduinoJson.h" +#include "hasplib.h" #include "hasp_debug.h" // for TAG_CONF /* ===== Default Event Processors ===== */ diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index f75a88c0..748eb1ff 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -1,15 +1,12 @@ /* MIT License - Copyright (c) 2019-2021 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include "ArduinoJson.h" -#include "lvgl.h" +#include "hasplib.h" #include #include "lang/lang.h" -#include "hasp_conf.h" #include "hasp_debug.h" #include "hasp_macro.h" -#include "hasp/hasp.h" #if(!defined(WINDOWS)) && (!defined(POSIX)) #include "ArduinoLog.h" diff --git a/src/hasp_gui.h b/src/hasp_gui.h index 3e33d068..cb7500a7 100644 --- a/src/hasp_gui.h +++ b/src/hasp_gui.h @@ -4,8 +4,7 @@ #ifndef HASP_GUI_H #define HASP_GUI_H -#include "ArduinoJson.h" -#include "lvgl.h" +#include "hasplib.h" struct gui_conf_t { diff --git a/src/hasplib.h b/src/hasplib.h index 60fdf8fb..70cd3bfa 100644 --- a/src/hasplib.h +++ b/src/hasplib.h @@ -1,3 +1,7 @@ +#ifdef ARDUINO +#include +#endif + #include #include #include diff --git a/src/sys/svc/hasp_http.cpp b/src/sys/svc/hasp_http.cpp index 4023a751..bb6e2fae 100644 --- a/src/sys/svc/hasp_http.cpp +++ b/src/sys/svc/hasp_http.cpp @@ -2,9 +2,8 @@ For full license information read the LICENSE file in the project folder */ //#include "webServer.h" -#include "ArduinoJson.h" +#include "hasplib.h" #include "ArduinoLog.h" -#include "lvgl.h" #if defined(ARDUINO_ARCH_ESP32) #include "Update.h" @@ -12,16 +11,11 @@ #include "hasp_conf.h" #include "dev/device.h" - -#include "hasp_gui.h" -#include "hasp/hasp_dispatch.h" -#include "hasp_debug.h" -#include "hasp_config.h" #include "hal/hasp_hal.h" -#include "hasp/hasp_dispatch.h" -#include "hasp/hasp_page.h" -#include "hasp/hasp.h" +#include "hasp_gui.h" +#include "hasp_debug.h" +#include "hasp_config.h" #if HASP_USE_HTTP > 0 diff --git a/src/sys/svc/hasp_slave.cpp b/src/sys/svc/hasp_slave.cpp index a3739845..39abf4df 100644 --- a/src/sys/svc/hasp_slave.cpp +++ b/src/sys/svc/hasp_slave.cpp @@ -1,17 +1,14 @@ /* MIT License - Copyright (c) 2019-2021 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include "hasp_conf.h" +#include "hasplib.h" #if HASP_USE_TASMOTA_CLIENT > 0 #include "hasp_slave.h" -#include "ArduinoJson.h" -#include "hasp_dispatch.h" #include "hasp_gui.h" #include "hasp_hal.h" #include "hasp_config.h" -#include "hasp.h" #include "tasmotaSlave.h" // set RX and TX pins diff --git a/src/sys/svc/hasp_telnet.cpp b/src/sys/svc/hasp_telnet.cpp index 52de8836..7678d19a 100644 --- a/src/sys/svc/hasp_telnet.cpp +++ b/src/sys/svc/hasp_telnet.cpp @@ -1,11 +1,10 @@ /* MIT License - Copyright (c) 2019-2021 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include "hasp_conf.h" +#include "hasplib.h" #if HASP_USE_TELNET > 0 -#include "ArduinoJson.h" #include "ConsoleInput.h" #include "hasp_debug.h" diff --git a/src/sys/svc/hasp_telnet.h b/src/sys/svc/hasp_telnet.h index 314e678b..d35612f0 100644 --- a/src/sys/svc/hasp_telnet.h +++ b/src/sys/svc/hasp_telnet.h @@ -6,8 +6,7 @@ #if HASP_USE_TELNET > 0 -#include "hasp_conf.h" -#include "ArduinoJson.h" +#include "hasplib.h" /* ===== Default Event Processors ===== */ void telnetSetup();