From 7acbca9f8fd375aa8bb00eed2463c2c0d5556f6f Mon Sep 17 00:00:00 2001 From: fvanroie Date: Sun, 13 Dec 2020 05:34:51 +0100 Subject: [PATCH] Header cleanup --- lib/lv_drv_fsmc_ili9341/fsmc_ili9341.cpp | 3 ++- src/hasp.cpp | 3 +-- src/hasp_config.h | 1 + src/hasp_debug.cpp | 5 +---- src/hasp_dispatch.cpp | 2 -- src/hasp_dispatch.h | 2 -- src/hasp_ethernet_esp32.cpp | 3 --- src/hasp_ethernet_stm32.cpp | 5 +---- src/hasp_gpio.cpp | 2 -- src/hasp_gui.cpp | 10 +++++----- src/hasp_http.cpp | 1 - src/hasp_http.h | 3 +-- src/hasp_mdns.cpp | 6 +----- src/hasp_mqtt.cpp | 3 --- src/hasp_oobe.cpp | 3 --- src/hasp_ota.cpp | 6 ++---- src/hasp_slave.cpp | 4 ++-- src/hasp_slave.h | 1 - src/hasp_telnet.cpp | 2 -- src/hasp_tft.cpp | 6 +++--- src/main.cpp | 4 +--- 21 files changed, 21 insertions(+), 54 deletions(-) diff --git a/lib/lv_drv_fsmc_ili9341/fsmc_ili9341.cpp b/lib/lv_drv_fsmc_ili9341/fsmc_ili9341.cpp index ad89e060..f525acd2 100644 --- a/lib/lv_drv_fsmc_ili9341/fsmc_ili9341.cpp +++ b/lib/lv_drv_fsmc_ili9341/fsmc_ili9341.cpp @@ -6,10 +6,11 @@ /********************* * INCLUDES *********************/ -#include "fsmc_ili9341.h" #if USE_FSMC_ILI9341 > 0 +#include "fsmc_ili9341.h" + #include #include #include diff --git a/src/hasp.cpp b/src/hasp.cpp index ed722fb1..2e44a3c9 100644 --- a/src/hasp.cpp +++ b/src/hasp.cpp @@ -2,8 +2,7 @@ For full license information read the LICENSE file in the project folder */ #include "hasp_conf.h" -#include -#include "ArduinoLog.h" + #include "ArduinoJson.h" #include "StreamUtils.h" // For EEPromStream diff --git a/src/hasp_config.h b/src/hasp_config.h index 49e2c931..cf228c22 100644 --- a/src/hasp_config.h +++ b/src/hasp_config.h @@ -4,6 +4,7 @@ #ifndef HASP_CONFIG_H #define HASP_CONFIG_H +#include "hasp_conf.h" #include "ArduinoJson.h" #include "hasp_debug.h" // for TAG_CONF diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index 804af890..80441fdf 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -13,14 +13,11 @@ =========================================================================== */ -#include "ArduinoJson.h" -#include "ArduinoLog.h" +#include "hasp_conf.h" #include "ConsoleInput.h" #include "lvgl.h" //#include "time.h" -#include "hasp_conf.h" - #if defined(ARDUINO_ARCH_ESP8266) #include // sntp_servermode_dhcp() #include diff --git a/src/hasp_dispatch.cpp b/src/hasp_dispatch.cpp index bb0bed88..a0295c69 100644 --- a/src/hasp_dispatch.cpp +++ b/src/hasp_dispatch.cpp @@ -1,8 +1,6 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include "ArduinoJson.h" -#include "ArduinoLog.h" #include "StringStream.h" #include "CharStream.h" diff --git a/src/hasp_dispatch.h b/src/hasp_dispatch.h index a2056149..6ab3e7ba 100644 --- a/src/hasp_dispatch.h +++ b/src/hasp_dispatch.h @@ -6,8 +6,6 @@ #include "ArduinoJson.h" -#define LOG_CMND_CTR "CMND: " - enum hasp_event_t { // even = released, odd = pressed HASP_EVENT_OFF = 0, HASP_EVENT_ON = 1, diff --git a/src/hasp_ethernet_esp32.cpp b/src/hasp_ethernet_esp32.cpp index 0811f16d..6138e3a8 100644 --- a/src/hasp_ethernet_esp32.cpp +++ b/src/hasp_ethernet_esp32.cpp @@ -1,9 +1,6 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include -#include "ArduinoJson.h" -#include "ArduinoLog.h" #include "hasp_conf.h" #include "hasp_hal.h" diff --git a/src/hasp_ethernet_stm32.cpp b/src/hasp_ethernet_stm32.cpp index 8386a4f0..fe2de37d 100644 --- a/src/hasp_ethernet_stm32.cpp +++ b/src/hasp_ethernet_stm32.cpp @@ -1,12 +1,9 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include -#include "ArduinoJson.h" -#include "ArduinoLog.h" +#include "hasp_conf.h" #include "hasp_debug.h" -#include "hasp_conf.h" #include "hasp_hal.h" #if HASP_USE_ETHERNET > 0 && !defined(ARDUINO_ARCH_ESP32) diff --git a/src/hasp_gpio.cpp b/src/hasp_gpio.cpp index 719ae236..af72383b 100644 --- a/src/hasp_gpio.cpp +++ b/src/hasp_gpio.cpp @@ -1,8 +1,6 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include "Arduino.h" -#include "ArduinoLog.h" #include "AceButton.h" #include "lv_conf.h" // For timing defines diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index efe7e499..982bd18e 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -1,8 +1,7 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include "Ticker.h" -#include "ArduinoLog.h" +#include "hasp_conf.h" #include "lv_conf.h" #include "lvgl.h" @@ -25,7 +24,6 @@ //#include "lv_zifont.h" -#include "hasp_conf.h" #include "hasp_debug.h" #include "hasp_config.h" #include "hasp_dispatch.h" @@ -36,6 +34,8 @@ //#include "lv_ex_conf.h" //#include "tpcal.h" +#include "Ticker.h" + #if HASP_USE_PNGDECODE > 0 #include "png_decoder.h" #endif @@ -408,8 +408,8 @@ bool IRAM_ATTR my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * touched = Touch_getXY(&touchX, &touchY, false); #else // xpt2046_alt_drv_read(indev_driver, data); - xpt2046_read(indev_driver, data); - if(data->state && guiSleeping != HASP_SLEEP_OFF) guiCheckSleep(); + // xpt2046_read(indev_driver, data); + // if(data->state && guiSleeping != HASP_SLEEP_OFF) guiCheckSleep(); return false; #endif diff --git a/src/hasp_http.cpp b/src/hasp_http.cpp index 037e8b1a..a7c5ca71 100644 --- a/src/hasp_http.cpp +++ b/src/hasp_http.cpp @@ -2,7 +2,6 @@ For full license information read the LICENSE file in the project folder */ //#include "webServer.h" -#include "Arduino.h" #include "ArduinoJson.h" #include "ArduinoLog.h" #include "lvgl.h" diff --git a/src/hasp_http.h b/src/hasp_http.h index ce2b9563..1bf1dd66 100644 --- a/src/hasp_http.h +++ b/src/hasp_http.h @@ -4,8 +4,7 @@ #ifndef HASP_HTTP_H #define HASP_HTTP_H -#include -#include "ArduinoJson.h" +#include "hasp_conf.h" void httpSetup(); void IRAM_ATTR httpLoop(void); diff --git a/src/hasp_mdns.cpp b/src/hasp_mdns.cpp index 5d663cd2..7a427f81 100644 --- a/src/hasp_mdns.cpp +++ b/src/hasp_mdns.cpp @@ -1,11 +1,9 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ +#include "hasp_conf.h" #if HASP_USE_MDNS > 0 -#include "ArduinoJson.h" -#include "ArduinoLog.h" - #if defined(ARDUINO_ARCH_ESP32) #include #elif defined(ARDUINO_ARCH_ESP8266) @@ -13,8 +11,6 @@ // MDNSResponder::hMDNSService hMDNSService; #endif -#include "hasp_conf.h" - #include "hasp_config.h" #include "hasp_debug.h" diff --git a/src/hasp_mqtt.cpp b/src/hasp_mqtt.cpp index 018f2c24..537c2342 100644 --- a/src/hasp_mqtt.cpp +++ b/src/hasp_mqtt.cpp @@ -4,9 +4,6 @@ #include "hasp_conf.h" #if HASP_USE_MQTT > 0 -#include -#include "ArduinoJson.h" -#include "ArduinoLog.h" #include "PubSubClient.h" #include "hasp_mqtt.h" diff --git a/src/hasp_oobe.cpp b/src/hasp_oobe.cpp index f8578134..a95f229b 100644 --- a/src/hasp_oobe.cpp +++ b/src/hasp_oobe.cpp @@ -2,9 +2,6 @@ For full license information read the LICENSE file in the project folder */ #include "hasp_conf.h" -#include -#include "ArduinoJson.h" -#include "ArduinoLog.h" #include "lvgl.h" #if LVGL_VERSION_MAJOR != 7 diff --git a/src/hasp_ota.cpp b/src/hasp_ota.cpp index 3c6fbd7f..4109c02c 100644 --- a/src/hasp_ota.cpp +++ b/src/hasp_ota.cpp @@ -3,10 +3,6 @@ #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) -#include -#include -#include "ArduinoJson.h" - #include "hasp_conf.h" #include "hasp_debug.h" @@ -24,6 +20,8 @@ #include #endif +#include + static WiFiClient otaClient; std::string otaUrl = "http://ota.netwize.be"; int16_t otaPort = HASP_OTA_PORT; diff --git a/src/hasp_slave.cpp b/src/hasp_slave.cpp index c422cb8b..40e464d7 100644 --- a/src/hasp_slave.cpp +++ b/src/hasp_slave.cpp @@ -1,12 +1,12 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ +#include "hasp_conf.h" #if HASP_USE_TASMOTA_SLAVE > 0 #include "hasp_slave.h" -#include #include "ArduinoJson.h" -#include "ArduinoLog.h" + #include "hasp_dispatch.h" #include "hasp_gui.h" #include "hasp_hal.h" diff --git a/src/hasp_slave.h b/src/hasp_slave.h index 28d8e49f..d6d15a39 100644 --- a/src/hasp_slave.h +++ b/src/hasp_slave.h @@ -15,7 +15,6 @@ void slave_send_obj_attribute_str(uint8_t pageid, uint8_t btnid, const char * at void slave_send_input(uint8_t id, const char * payload); void slave_send_statusupdate(); - void slaveSetup(); void IRAM_ATTR slaveLoop(void); diff --git a/src/hasp_telnet.cpp b/src/hasp_telnet.cpp index 5ee54c26..c6817ffc 100644 --- a/src/hasp_telnet.cpp +++ b/src/hasp_telnet.cpp @@ -4,9 +4,7 @@ #include "hasp_conf.h" #if HASP_USE_TELNET > 0 -#include "Arduino.h" #include "ArduinoJson.h" -#include "ArduinoLog.h" #include "ConsoleInput.h" #include "hasp_debug.h" diff --git a/src/hasp_tft.cpp b/src/hasp_tft.cpp index 6801a593..37bbe1e0 100644 --- a/src/hasp_tft.cpp +++ b/src/hasp_tft.cpp @@ -2,17 +2,17 @@ For full license information read the LICENSE file in the project folder */ #include "ArduinoJson.h" -#include "ArduinoLog.h" #ifndef USE_FSMC -#include "TFT_eSPI.h" - +#include "hasp_conf.h" #include "hasp_tft.h" #include "hasp_hal.h" #include "hasp_gpio.h" // PinNames #include "hasp_debug.h" +#include "TFT_eSPI.h" + #if defined(ARDUINO_ARCH_ESP8266) ADC_MODE(ADC_VCC); // tftShowConfig measures the voltage on the pin #endif diff --git a/src/main.cpp b/src/main.cpp index 20e57191..bf451f99 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,10 +1,8 @@ /* MIT License - Copyright (c) 2020 Francis Van Roie For full license information read the LICENSE file in the project folder */ -#include "hasp_conf.h" // load first #include - -#include "hasp_conf.h" +#include "hasp_conf.h" // load first #include "hasp_debug.h" #include "hasp_config.h"