From e2670ab702e629a31d04da44a85c018d3e153f12 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Thu, 26 Jan 2023 01:01:13 +0100 Subject: [PATCH] Move #include "hasp_config.h" to hasplib --- src/hasp/hasp.cpp | 1 - src/hasp/hasp_dispatch.cpp | 4 ---- src/hasp/hasp_font.cpp | 4 ++-- src/hasp/hasp_nvs.h | 4 +++- src/hasp/hasp_object.h | 14 +++++++++----- src/hasp/hasp_task.cpp | 3 +-- src/hasp_config.h | 4 +++- src/hasp_gui.cpp | 3 +-- src/hasp_oobe.cpp | 3 +-- src/hasp_oobe.h | 2 +- src/hasplib.h | 6 +++++- src/main_arduino.cpp | 4 ++-- src/mqtt/hasp_mqtt.h | 4 ++-- src/mqtt/hasp_mqtt_paho_single.cpp | 16 ++++++++-------- src/mqtt/hasp_mqtt_pubsubclient.cpp | 16 ++++++++-------- src/sys/gpio/hasp_gpio.cpp | 3 +-- src/sys/net/hasp_time.cpp | 13 ++++++++----- src/sys/net/hasp_time.h | 2 +- src/sys/net/hasp_wifi.h | 2 +- src/sys/svc/hasp_console.cpp | 3 +-- src/sys/svc/hasp_console.h | 2 +- src/sys/svc/hasp_ftp.cpp | 3 +-- src/sys/svc/hasp_ftp.h | 2 +- src/sys/svc/hasp_http.cpp | 5 ++--- src/sys/svc/hasp_http.h | 2 +- src/sys/svc/hasp_http_async.cpp | 3 +-- src/sys/svc/hasp_mdns.h | 2 +- src/sys/svc/hasp_ota.cpp | 7 +++---- src/sys/svc/hasp_telnet.cpp | 3 +-- 29 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/hasp/hasp.cpp b/src/hasp/hasp.cpp index 52768899..d6fe3818 100644 --- a/src/hasp/hasp.cpp +++ b/src/hasp/hasp.cpp @@ -27,7 +27,6 @@ #if HASP_USE_CONFIG > 0 #include "lv_fs_if.h" -#include "hasp_config.h" #include "font/hasp_font_loader.h" // #include "hasp_filesystem.h" included in hasp_conf.h #endif diff --git a/src/hasp/hasp_dispatch.cpp b/src/hasp/hasp_dispatch.cpp index b1703ad6..dff7b204 100644 --- a/src/hasp/hasp_dispatch.cpp +++ b/src/hasp/hasp_dispatch.cpp @@ -37,10 +37,6 @@ #endif #endif -#if HASP_USE_CONFIG > 0 -#include "hasp_config.h" -#endif - dispatch_conf_t dispatch_setings = {.teleperiod = 300}; uint16_t dispatchSecondsToNextTeleperiod = 0; diff --git a/src/hasp/hasp_font.cpp b/src/hasp/hasp_font.cpp index c5d7b22f..1f50c81a 100644 --- a/src/hasp/hasp_font.cpp +++ b/src/hasp/hasp_font.cpp @@ -57,8 +57,6 @@ const uint8_t* font_dummy_glyph_bitmap(const struct _lv_font_struct*, uint32_t) void font_setup() { - _lv_ll_init(&hasp_fonts_ll, sizeof(hasp_font_info_t)); - #if(HASP_USE_FREETYPE > 0) // initialize the FreeType renderer #if defined(ARDUINO_ARCH_ESP32) @@ -77,6 +75,8 @@ void font_setup() #else LOG_VERBOSE(TAG_FONT, F("FreeType " D_SERVICE_DISABLED)); #endif // HASP_USE_FREETYPE + + _lv_ll_init(&hasp_fonts_ll, sizeof(hasp_font_info_t)); } size_t font_split_payload(const char* payload) diff --git a/src/hasp/hasp_nvs.h b/src/hasp/hasp_nvs.h index 364b15b3..178ed0a5 100644 --- a/src/hasp/hasp_nvs.h +++ b/src/hasp/hasp_nvs.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_NVS_H @@ -9,6 +9,8 @@ #include "hasplib.h" #include +void nvs_setup(); +bool nvs_user_begin(Preferences& preferences, const char* key, bool readonly); bool nvs_clear_user_config(); bool nvsUpdateString(Preferences& preferences, const char* key, JsonVariant value); bool nvsUpdateUInt(Preferences& preferences, const char* key, JsonVariant value); diff --git a/src/hasp/hasp_object.h b/src/hasp/hasp_object.h index 504a09a4..f8284b1b 100644 --- a/src/hasp/hasp_object.h +++ b/src/hasp/hasp_object.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_OBJECT_H @@ -41,8 +41,10 @@ enum lv_hasp_obj_type_t { LV_HASP_TABVIEW = 6, // placeholder LV_HASP_TAB = 7, // placeholder LV_HASP_PAGE = 8, // Obsolete in v8 + LV_HASP_SPAN = 9, // placeholder /* Controls */ + LV_HASP_KEYBOARD = 10, // placeholder LV_HASP_OBJECT = 11, LV_HASP_BUTTON = 12, LV_HASP_BTNMATRIX = 13, @@ -71,12 +73,14 @@ enum lv_hasp_obj_type_t { LV_HASP_LIST = 31, // placeholder LV_HASP_TABLE = 32, LV_HASP_CALENDER = 33, + LV_HASP_MENU = 34, // placeholder /* Graphics */ - LV_HASP_LINE = 36, - LV_HASP_IMAGE = 37, // placeholder - LV_HASP_CANVAS = 38, // placeholder - LV_HASP_MASK = 39, // placeholder + LV_HASP_LINE = 36, + LV_HASP_IMAGE = 37, // placeholder + LV_HASP_ANIMIMAGE = 38, // placeholder + LV_HASP_CANVAS = 39, // placeholder + LV_HASP_MASK = 40, // placeholder /* Custom */ LV_HASP_ALARM = 60, diff --git a/src/hasp/hasp_task.cpp b/src/hasp/hasp_task.cpp index 7c0ebc7f..23fb2027 100644 --- a/src/hasp/hasp_task.cpp +++ b/src/hasp/hasp_task.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" @@ -12,7 +12,6 @@ For full license information read the LICENSE file in the project folder */ #endif #if HASP_USE_CONFIG > 0 -#include "hasp_config.h" #include "hasp_gui.h" #endif diff --git a/src/hasp_config.h b/src/hasp_config.h index 49532220..b2144bc2 100644 --- a/src/hasp_config.h +++ b/src/hasp_config.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if HASP_USE_CONFIG > 0 @@ -52,7 +52,9 @@ const char FP_CONFIG_NAME[] PROGMEM = "name"; const char FP_CONFIG_USER[] PROGMEM = "user"; const char FP_CONFIG_PASS[] PROGMEM = "pass"; const char FP_CONFIG_SSID[] PROGMEM = "ssid"; +const char FP_CONFIG_NODE[] PROGMEM = "node"; const char FP_CONFIG_GROUP[] PROGMEM = "group"; +const char FP_CONFIG_BROADCAST[] PROGMEM = "group"; const char FP_CONFIG_BAUD[] PROGMEM = "baud"; const char FP_CONFIG_LOG[] PROGMEM = "log"; const char FP_CONFIG_PROTOCOL[] PROGMEM = "proto"; diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 0a492b47..95def7f4 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" @@ -12,7 +12,6 @@ #include "drv/touch/touch_driver.h" #include "hasp_debug.h" -#include "hasp_config.h" #include "hasp_gui.h" #include "hasp_oobe.h" diff --git a/src/hasp_oobe.cpp b/src/hasp_oobe.cpp index d26d337f..ebf86692 100644 --- a/src/hasp_oobe.cpp +++ b/src/hasp_oobe.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if HASP_USE_CONFIG > 0 @@ -6,7 +6,6 @@ #include "hasplib.h" #include "hasp_gui.h" -#include "hasp_config.h" #include "sys/net/hasp_wifi.h" #include "hasp/hasp_dispatch.h" diff --git a/src/hasp_oobe.h b/src/hasp_oobe.h index 571076c1..931ab220 100644 --- a/src/hasp_oobe.h +++ b/src/hasp_oobe.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if HASP_USE_CONFIG > 0 diff --git a/src/hasplib.h b/src/hasplib.h index 3c2a47f2..1f83dee3 100644 --- a/src/hasplib.h +++ b/src/hasplib.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifdef ARDUINO @@ -44,6 +44,10 @@ #include "lv_freetype.h" #endif +#if HASP_USE_CONFIG > 0 +#include "hasp_config.h" +#endif + #if HASP_USE_PNGDECODE > 0 #include "lv_png.h" #endif diff --git a/src/main_arduino.cpp b/src/main_arduino.cpp index ac536f5f..35a8a966 100644 --- a/src/main_arduino.cpp +++ b/src/main_arduino.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if !(defined(WINDOWS) || defined(POSIX)) @@ -25,7 +25,6 @@ #endif #if HASP_USE_CONFIG > 0 -#include "hasp_config.h" #include "hasp_gui.h" #endif @@ -51,6 +50,7 @@ void setup() /**************************** * Storage initializations ***************************/ + // nvs_setup(); #if HASP_USE_EEPROM > 0 eepromSetup(); // Don't start at boot, only at write #endif diff --git a/src/mqtt/hasp_mqtt.h b/src/mqtt/hasp_mqtt.h index 8ec47d98..5ae231ea 100644 --- a/src/mqtt/hasp_mqtt.h +++ b/src/mqtt/hasp_mqtt.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_MQTT_H @@ -22,7 +22,7 @@ void mqttEvery5Seconds(bool wifiIsConnected); void mqttStart(); void mqttStop(); -int mqtt_send_object_state(uint8_t pageid, uint8_t btnid, const char* payload); +// int mqtt_send_object_state(uint8_t pageid, uint8_t btnid, const char* payload); int mqtt_send_state(const char* subtopic, const char* payload); int mqtt_send_discovery(const char* payload, size_t len); int mqttPublish(const char* topic, const char* payload, size_t len, bool retain); diff --git a/src/mqtt/hasp_mqtt_paho_single.cpp b/src/mqtt/hasp_mqtt_paho_single.cpp index 8f8e0bc4..78d2e6ce 100644 --- a/src/mqtt/hasp_mqtt_paho_single.cpp +++ b/src/mqtt/hasp_mqtt_paho_single.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ /* Single threaded synchronous paho client */ @@ -238,13 +238,13 @@ int mqtt_send_discovery(const char* payload, size_t len) return mqttPublish(tmp_topic, payload, len, false); } -int mqtt_send_object_state(uint8_t pageid, uint8_t btnid, const char* payload) -{ - char tmp_topic[mqttNodeTopic.length() + 20]; - snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%s" MQTT_TOPIC_STATE "/p%ub%u"), mqttNodeTopic.c_str(), pageid, - btnid); - return mqttPublish(tmp_topic, payload, strlen(payload), false); -} +// int mqtt_send_object_state(uint8_t pageid, uint8_t btnid, const char* payload) +// { +// char tmp_topic[mqttNodeTopic.length() + 20]; +// snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%s" MQTT_TOPIC_STATE "/p%ub%u"), mqttNodeTopic.c_str(), pageid, +// btnid); +// return mqttPublish(tmp_topic, payload, strlen(payload), false); +// } static void onConnect(void* context) { diff --git a/src/mqtt/hasp_mqtt_pubsubclient.cpp b/src/mqtt/hasp_mqtt_pubsubclient.cpp index a2b8ed2d..2c04db2b 100644 --- a/src/mqtt/hasp_mqtt_pubsubclient.cpp +++ b/src/mqtt/hasp_mqtt_pubsubclient.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasp_conf.h" @@ -109,13 +109,13 @@ bool mqtt_send_lwt(bool online) return res; } -int mqtt_send_object_state(uint8_t pageid, uint8_t btnid, const char* payload) -{ - char tmp_topic[strlen(mqttNodeTopic) + 16]; - snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%s" MQTT_TOPIC_STATE "/" HASP_OBJECT_NOTATION), mqttNodeTopic, - pageid, btnid); - return mqttPublish(tmp_topic, payload, false); -} +// int mqtt_send_object_state(uint8_t pageid, uint8_t btnid, const char* payload) +// { +// char tmp_topic[strlen(mqttNodeTopic) + 16]; +// snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%s" MQTT_TOPIC_STATE "/" HASP_OBJECT_NOTATION), mqttNodeTopic, +// pageid, btnid); +// return mqttPublish(tmp_topic, payload, false); +// } int mqtt_send_state(const char* subtopic, const char* payload) { diff --git a/src/sys/gpio/hasp_gpio.cpp b/src/sys/gpio/hasp_gpio.cpp index f712f9c2..51449467 100644 --- a/src/sys/gpio/hasp_gpio.cpp +++ b/src/sys/gpio/hasp_gpio.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "lv_conf.h" // For timing defines @@ -6,7 +6,6 @@ #include "hasplib.h" #include "hasp_gpio.h" -#include "hasp_config.h" // Device Drivers #include "dev/device.h" diff --git a/src/sys/net/hasp_time.cpp b/src/sys/net/hasp_time.cpp index 9fde6b5d..0fbf4edf 100644 --- a/src/sys/net/hasp_time.cpp +++ b/src/sys/net/hasp_time.cpp @@ -1,3 +1,6 @@ +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie + For full license information read the LICENSE file in the project folder */ + #include #include @@ -47,15 +50,15 @@ void timeSetup() #endif #if defined(ARDUINO_ARCH_ESP32) Preferences preferences; - preferences.begin("time", true); + nvs_user_begin(preferences,"time", true); mytz = preferences.getString("tz", MYTZ); ntp1 = preferences.getString("ntp1", NTPSERVER1); ntp2 = preferences.getString("ntp2", NTPSERVER2); ntp3 = preferences.getString("ntp3", NTPSERVER3); - LOG_WARNING(TAG_TIME, F("TIMEZONE: %s"), mytz.c_str()); - LOG_WARNING(TAG_TIME, F("NTPSERVER: %s %s %s"), ntp1.c_str(), ntp2.c_str(), ntp3.c_str()); + LOG_VERBOSE(TAG_TIME, F("TIMEZONE: %s"), mytz.c_str()); + LOG_VERBOSE(TAG_TIME, F("NTPSERVER: %s %s %s"), ntp1.c_str(), ntp2.c_str(), ntp3.c_str()); configTzTime(mytz.c_str(), ntp1.c_str(), ntp2.c_str(), ntp3.c_str()); preferences.end(); @@ -69,7 +72,7 @@ bool timeGetConfig(const JsonObject& settings) Preferences preferences; bool changed = false; - preferences.begin("time", true); + nvs_user_begin(preferences,"time", true); settings["tz"] = preferences.getString("tz", MYTZ); settings["ntp"][0] = preferences.getString("ntp1", NTPSERVER1); settings["ntp"][1] = preferences.getString("ntp2", NTPSERVER2); @@ -94,7 +97,7 @@ bool timeGetConfig(const JsonObject& settings) bool timeSetConfig(const JsonObject& settings) { Preferences preferences; - preferences.begin("time", false); + nvs_user_begin(preferences,"time", false); configOutput(settings, TAG_TIME); bool changed = false; diff --git a/src/sys/net/hasp_time.h b/src/sys/net/hasp_time.h index d2100a54..be175091 100644 --- a/src/sys/net/hasp_time.h +++ b/src/sys/net/hasp_time.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_TIME_H diff --git a/src/sys/net/hasp_wifi.h b/src/sys/net/hasp_wifi.h index cc168d18..1418efa0 100644 --- a/src/sys/net/hasp_wifi.h +++ b/src/sys/net/hasp_wifi.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_WIFI_H diff --git a/src/sys/svc/hasp_console.cpp b/src/sys/svc/hasp_console.cpp index ddd5c372..2ca2902b 100644 --- a/src/sys/svc/hasp_console.cpp +++ b/src/sys/svc/hasp_console.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" @@ -9,7 +9,6 @@ #include #include "hasp_debug.h" -#include "hasp_config.h" #include "hasp_console.h" #include "../../hasp/hasp_dispatch.h" diff --git a/src/sys/svc/hasp_console.h b/src/sys/svc/hasp_console.h index a3a1ae67..ac2e4223 100644 --- a/src/sys/svc/hasp_console.h +++ b/src/sys/svc/hasp_console.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_CONSOLE_H diff --git a/src/sys/svc/hasp_ftp.cpp b/src/sys/svc/hasp_ftp.cpp index 1fd38e76..d4288f9b 100644 --- a/src/sys/svc/hasp_ftp.cpp +++ b/src/sys/svc/hasp_ftp.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" @@ -6,7 +6,6 @@ #if HASP_USE_FTP > 0 #include "hasp_debug.h" -#include "hasp_config.h" #include "hasp_ftp.h" #include "hasp_http.h" #include "hasp_filesystem.h" diff --git a/src/sys/svc/hasp_ftp.h b/src/sys/svc/hasp_ftp.h index eb00f1c0..11571a95 100644 --- a/src/sys/svc/hasp_ftp.h +++ b/src/sys/svc/hasp_ftp.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_FTP_H diff --git a/src/sys/svc/hasp_http.cpp b/src/sys/svc/hasp_http.cpp index de57312d..4bd3213d 100644 --- a/src/sys/svc/hasp_http.cpp +++ b/src/sys/svc/hasp_http.cpp @@ -20,7 +20,6 @@ #include "hasp_gui.h" #include "hasp_debug.h" -#include "hasp_config.h" #if HASP_USE_HTTP > 0 #include "sys/net/hasp_network.h" @@ -2506,7 +2505,7 @@ static inline void webStartConfigPortal() void httpSetup() { Preferences preferences; - preferences.begin("http", true); + nvs_user_begin(preferences,"http", true); String password = preferences.getString(FP_CONFIG_PASS, HTTP_PASSWORD); strncpy(http_config.password, password.c_str(), sizeof(http_config.password)); LOG_DEBUG(TAG_HTTP, F(D_BULLET "Read %s => %s (%d bytes)"), FP_CONFIG_PASS, password.c_str(), password.length()); @@ -2654,7 +2653,7 @@ bool httpGetConfig(const JsonObject& settings) bool httpSetConfig(const JsonObject& settings) { Preferences preferences; - preferences.begin("http", false); + nvs_user_begin(preferences,"http", false); configOutput(settings, TAG_HTTP); bool changed = false; diff --git a/src/sys/svc/hasp_http.h b/src/sys/svc/hasp_http.h index 12430a14..a09fcf4b 100644 --- a/src/sys/svc/hasp_http.h +++ b/src/sys/svc/hasp_http.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_HTTP_H diff --git a/src/sys/svc/hasp_http_async.cpp b/src/sys/svc/hasp_http_async.cpp index 482a26fa..0bfd3153 100644 --- a/src/sys/svc/hasp_http_async.cpp +++ b/src/sys/svc/hasp_http_async.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ //#include "webServer.h" @@ -15,7 +15,6 @@ #include "hasp_gui.h" #include "hasp_debug.h" -#include "hasp_config.h" #if HASP_USE_HTTP_ASYNC > 0 #include "sys/net/hasp_network.h" diff --git a/src/sys/svc/hasp_mdns.h b/src/sys/svc/hasp_mdns.h index 9a6993b4..2f472814 100644 --- a/src/sys/svc/hasp_mdns.h +++ b/src/sys/svc/hasp_mdns.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_MDNS_H diff --git a/src/sys/svc/hasp_ota.cpp b/src/sys/svc/hasp_ota.cpp index fdc19702..179f62ff 100644 --- a/src/sys/svc/hasp_ota.cpp +++ b/src/sys/svc/hasp_ota.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2022 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) @@ -6,7 +6,6 @@ #include "hasplib.h" #include "hasp_debug.h" -#include "hasp_config.h" #include "hasp_ota.h" #if defined(ARDUINO_ARCH_ESP8266) @@ -370,7 +369,7 @@ bool otaGetConfig(const JsonObject& settings) Preferences preferences; bool changed = false; - preferences.begin("ota", true); + nvs_user_begin(preferences,"ota", true); settings["url"] = preferences.getString("url", HASP_OTA_URL); settings["redirect"] = preferences.getUInt("redirect", 0); preferences.end(); @@ -393,7 +392,7 @@ bool otaGetConfig(const JsonObject& settings) bool otaSetConfig(const JsonObject& settings) { Preferences preferences; - preferences.begin("ota", false); + nvs_user_begin(preferences,"ota", false); configOutput(settings, TAG_OTA); bool changed = false; diff --git a/src/sys/svc/hasp_telnet.cpp b/src/sys/svc/hasp_telnet.cpp index ade74050..a55e4336 100644 --- a/src/sys/svc/hasp_telnet.cpp +++ b/src/sys/svc/hasp_telnet.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2021 Francis Van Roie +/* MIT License - Copyright (c) 2019-2023 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" @@ -9,7 +9,6 @@ #include #include "hasp_debug.h" -#include "hasp_config.h" #include "hasp_telnet.h" #include "hasp_http.h"