From 21bbdb9c32f6576bb9d29d519c09b83318b751d4 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Thu, 6 May 2021 04:19:41 +0200 Subject: [PATCH] Cleanup headers --- include/hasp_conf.h | 8 +++++ src/hasp/hasp.h | 5 +-- src/hasp/hasp_dispatch.h | 3 +- src/hasp/hasp_object.h | 71 +++++++++++++++++++------------------- src/hasp/hasp_parser.h | 3 +- src/mqtt/hasp_mqtt.h | 4 +-- src/sys/gpio/hasp_gpio.cpp | 4 +-- src/sys/gpio/hasp_gpio.h | 2 +- 8 files changed, 50 insertions(+), 50 deletions(-) diff --git a/include/hasp_conf.h b/include/hasp_conf.h index ba2bbfff..6501e974 100644 --- a/include/hasp_conf.h +++ b/include/hasp_conf.h @@ -240,6 +240,14 @@ static WiFiSpiClass WiFi; #include "sys/svc/hasp_slave.h" #endif +#ifndef HASP_ATTRIBUTE_FAST_MEM +#define HASP_ATTRIBUTE_FAST_MEM +#endif + +#ifndef IRAM_ATTR +#define IRAM_ATTR +#endif + #ifndef FPSTR #define FPSTR(pstr_pointer) (reinterpret_cast(pstr_pointer)) #endif diff --git a/src/hasp/hasp.h b/src/hasp/hasp.h index 7a946d4b..0db81f9f 100644 --- a/src/hasp/hasp.h +++ b/src/hasp/hasp.h @@ -8,10 +8,7 @@ #include "Arduino.h" #endif -#include "lvgl.h" -#include "hasp_conf.h" - -#include "hasp_conf.h" +#include "hasplib.h" #if HASP_USE_DEBUG > 0 #include "../hasp_debug.h" diff --git a/src/hasp/hasp_dispatch.h b/src/hasp/hasp_dispatch.h index edc805c5..75f36650 100644 --- a/src/hasp/hasp_dispatch.h +++ b/src/hasp/hasp_dispatch.h @@ -4,8 +4,7 @@ #ifndef HASP_DISPATCH_H #define HASP_DISPATCH_H -#include "ArduinoJson.h" -#include "lvgl.h" +#include "hasplib.h" struct dispatch_conf_t { diff --git a/src/hasp/hasp_object.h b/src/hasp/hasp_object.h index 2b2eecc1..4dcbe5bb 100644 --- a/src/hasp/hasp_object.h +++ b/src/hasp/hasp_object.h @@ -4,8 +4,7 @@ #ifndef HASP_OBJECT_H #define HASP_OBJECT_H -#include -#include "lvgl.h" +#include "hasplib.h" const char FP_PAGE[] PROGMEM = "page"; const char FP_ID[] PROGMEM = "id"; @@ -15,50 +14,50 @@ const char FP_PARENTID[] PROGMEM = "parentid"; const char FP_GROUPID[] PROGMEM = "groupid"; enum lv_hasp_obj_type_t { + /* Containers */ + LV_HASP_SCREEN = 1, + LV_HASP_CONTAINER = 2, + LV_HASP_WINDOW = 3, // placeholder + LV_HASP_MSGBOX = 4, // placeholder + LV_HASP_TILEVIEW = 5, // placeholder + LV_HASP_TABVIEW = 6, // placeholder + LV_HASP_TAB = 7, // placeholder + LV_HASP_PAGE = 8, // Obsolete in v8 + /* Controls */ - LV_HASP_OBJECT = 91, // 10 - LV_HASP_BUTTON = 10, // 12 + LV_HASP_OBJECT = 11, + LV_HASP_BUTTON = 12, LV_HASP_BTNMATRIX = 13, LV_HASP_IMGBTN = 14, // placeholder - LV_HASP_CHECKBOX = 11, // 15 - LV_HASP_SWITCH = 40, // 16 - LV_HASP_SLIDER = 30, // 17 + LV_HASP_CHECKBOX = 15, + LV_HASP_SWITCH = 16, + LV_HASP_SLIDER = 17, LV_HASP_TEXTAREA = 18, // placeholder LV_HASP_SPINBOX = 19, // placeholder LV_HASP_CPICKER = 20, - /* Selectors */ - LV_HASP_DROPDOWN = 50, - LV_HASP_ROLLER = 51, - LV_HASP_LIST = 52, // placeholder - LV_HASP_TABLE = 53, - LV_HASP_CALENDER = 54, - - /* Containers */ - LV_HASP_SCREEN = 1, - LV_HASP_CONTAINER = 70, - LV_HASP_WINDOW = 71, // placeholder - LV_HASP_MSGBOX = 72, // placeholder - LV_HASP_TILEVIEW = 73, // placeholder - LV_HASP_TABVIEW = 74, // placeholder - LV_HASP_TAB = 75, // placeholder - LV_HASP_PAGE = 79, // Obsolete in v8 - /* Visualizers */ - LV_HASP_LABEL = 12, // 30 - LV_HASP_GAUGE = 31, - LV_HASP_BAR = 32, - LV_HASP_LMETER = 33, - LV_HASP_LED = 41, // 34 - LV_HASP_ARC = 22, // 35 - LV_HASP_SPINNER = 21, // 36 - LV_HASP_CHART = 37, + LV_HASP_LABEL = 21, + LV_HASP_GAUGE = 22, + LV_HASP_BAR = 23, + LV_HASP_LMETER = 24, + LV_HASP_LED = 25, + LV_HASP_ARC = 26, + LV_HASP_SPINNER = 27, + LV_HASP_CHART = 28, + + /* Selectors */ + LV_HASP_DROPDOWN = 29, + LV_HASP_ROLLER = 30, + LV_HASP_LIST = 31, // placeholder + LV_HASP_TABLE = 32, + LV_HASP_CALENDER = 33, /* Graphics */ - LV_HASP_LINE = 60, - LV_HASP_IMAGE = 61, // placeholder - LV_HASP_CANVAS = 62, // placeholder - LV_HASP_MASK = 63, // placeholder + LV_HASP_LINE = 36, + LV_HASP_IMAGE = 37, // placeholder + LV_HASP_CANVAS = 38, // placeholder + LV_HASP_MASK = 39, // placeholder }; void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id); diff --git a/src/hasp/hasp_parser.h b/src/hasp/hasp_parser.h index 862ee32f..3a2e0118 100644 --- a/src/hasp/hasp_parser.h +++ b/src/hasp/hasp_parser.h @@ -4,8 +4,7 @@ #ifndef HASP_PARSER_H #define HASP_PARSER_H -#include "lvgl.h" -#include "hasp_conf.h" +#include "hasplib.h" class Parser { diff --git a/src/mqtt/hasp_mqtt.h b/src/mqtt/hasp_mqtt.h index af0f02b7..5c8b6f37 100644 --- a/src/mqtt/hasp_mqtt.h +++ b/src/mqtt/hasp_mqtt.h @@ -5,9 +5,7 @@ #define HASP_MQTT_H #include -#include "ArduinoJson.h" - -#include "hasp_conf.h" +#include "hasplib.h" // #if defined(WINDOWS) || defined(POSIX) // #define __FlashStringHelper char diff --git a/src/sys/gpio/hasp_gpio.cpp b/src/sys/gpio/hasp_gpio.cpp index 44912d9f..b613ca50 100644 --- a/src/sys/gpio/hasp_gpio.cpp +++ b/src/sys/gpio/hasp_gpio.cpp @@ -4,6 +4,7 @@ #include "lv_conf.h" // For timing defines #include "hasplib.h" + #include "hasp_gpio.h" #include "hasp_config.h" @@ -537,8 +538,7 @@ void gpio_set_normalized_group_values(uint8_t group, int32_t val, int32_t min, i // Set all pins first, minimizes delays for(uint8_t k = 0; k < HASP_NUM_GPIO_CONFIG; k++) { hasp_gpio_config_t* gpio = &gpioConfig[k]; - if(gpio->group == group && // group members that are outputs - gpioConfigInUse(k)) + if(gpio->group == group && gpioConfigInUse(k)) // group members that are outputs gpio_set_normalized_value(gpio, val, min, max); } diff --git a/src/sys/gpio/hasp_gpio.h b/src/sys/gpio/hasp_gpio.h index 25de68b5..8ff2fad3 100644 --- a/src/sys/gpio/hasp_gpio.h +++ b/src/sys/gpio/hasp_gpio.h @@ -4,7 +4,7 @@ #ifndef HASP_GPIO_H #define HASP_GPIO_H -#include "ArduinoJson.h" +#include "hasplib.h" #ifdef __cplusplus extern "C" {