diff --git a/include/hasp_conf.h b/include/hasp_conf.h index 7d133d6c..156f86f9 100644 --- a/include/hasp_conf.h +++ b/include/hasp_conf.h @@ -101,19 +101,20 @@ #include #if HASP_USE_SPIFFS > 0 -#if defined(ARDUINO_ARCH_ESP32) -#include "SPIFFS.h" -#endif -#include // Include the SPIFFS library +// #if defined(ARDUINO_ARCH_ESP32) +// #include "SPIFFS.h" +// #endif +// #include // Include the SPIFFS library #include "hasp_filesystem.h" #endif #if HASP_USE_LITTLEFS > 0 -#if defined(ARDUINO_ARCH_ESP32) -#include "LITTLEFS.h" -#elif defined(ARDUINO_ARCH_ESP8266) -#include // Include the FS library -#endif +// #if defined(ARDUINO_ARCH_ESP32) +// #include "LITTLEFS.h" +// #elif defined(ARDUINO_ARCH_ESP8266) +// #include // Include the FS library +// #include +// #endif #include "hasp_filesystem.h" #endif diff --git a/include/lv_conf_v7.h b/include/lv_conf_v7.h index a829d1b6..bcce6d62 100644 --- a/include/lv_conf_v7.h +++ b/include/lv_conf_v7.h @@ -377,10 +377,10 @@ typedef void* lv_font_user_data_t; /*Always set a default font from the built-in fonts*/ #if LV_HIGH_RESOURCE_MCU>0 // #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_montserrat_16); -#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(robotocondensed_regular_28_nokern) \ +#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(robotocondensed_regular_12_nokern) \ LV_FONT_DECLARE(robotocondensed_regular_22_nokern) \ LV_FONT_DECLARE(robotocondensed_regular_16_nokern) \ - LV_FONT_DECLARE(robotocondensed_regular_12_nokern) \ + LV_FONT_DECLARE(robotocondensed_regular_28_nokern) \ #define LV_FONT_DEFAULT &robotocondensed_regular_16_nokern //&lv_font_montserrat_16 #else diff --git a/src/drv/hasp_drv_ft5206.cpp b/src/drv/hasp_drv_ft5206.cpp index d14aacf5..6b869be0 100644 --- a/src/drv/hasp_drv_ft5206.cpp +++ b/src/drv/hasp_drv_ft5206.cpp @@ -20,9 +20,7 @@ bool IRAM_ATTR FT5206_getXY(int16_t * touchX, int16_t * touchY, bool debug) *touchY = tp.y; if(debug) { - char tempString[128]; - sprintf(tempString, F("FT5206 touched x: %d y: %d\n"), tp.x, tp.y); // TODO: literal string - Serial.print(tempString); + Log.verbose(TAG_DRVR, F("FT5206 touched x: %d y: %d\n"), tp.x, tp.y); } return true; diff --git a/src/hasp/hasp.cpp b/src/hasp/hasp.cpp index 4b2c4d73..38448ded 100644 --- a/src/hasp/hasp.cpp +++ b/src/hasp/hasp.cpp @@ -503,7 +503,7 @@ void hasp_background(uint16_t pageid, uint16_t imageid) void haspGetVersion(char * version, size_t len) { - snprintf_P(version, len, "%u.%u.%u", HASP_VERSION_MAJOR, HASP_VERSION_MINOR, HASP_VERSION_REVISION); + snprintf_P(version, len, PSTR("%u.%u.%u"), HASP_VER_MAJ, HASP_VER_MIN, HASP_VER_REV); } void haspClearPage(uint16_t pageid) diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index 88e66abf..79d94051 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -120,7 +120,7 @@ void debugPrintHaspHeader(Print * output) " Home Automation Switch Plate\r\n" " Open Hardware edition v")); char buffer[32]; - snprintf_P(buffer, sizeof(buffer), PSTR("%u.%u.%u"), HASP_VERSION_MAJOR, HASP_VERSION_MINOR, HASP_VERSION_REVISION); + haspGetVersion(buffer, sizeof(buffer)); output->println(buffer); output->println(); } @@ -648,7 +648,7 @@ void debugPreSetup(JsonObject settings) Serial.flush(); Log.trace(TAG_DEBG, F("Serial started at %u baud"), baudrate); - Log.trace(TAG_DEBG, F("Environment: " PIOENV_STR)); + Log.trace(TAG_DEBG, F("Environment: " PIOENV)); } } diff --git a/src/hasp_filesystem.h b/src/hasp_filesystem.h index d918ab58..ed3b773b 100644 --- a/src/hasp_filesystem.h +++ b/src/hasp_filesystem.h @@ -12,24 +12,22 @@ void filesystemList(); void filesystemInfo(); #if defined(ARDUINO_ARCH_ESP32) -#if HASP_USE_SPIFFS > 0 -#include "SPIFFS.h" -#elif HASP_USE_LITTLEFS > 0 -#include "LITTLEFS.h" -#endif + #if HASP_USE_SPIFFS > 0 + #include "SPIFFS.h" + #define HASP_FS SPIFFS + #elif HASP_USE_LITTLEFS > 0 + #include "LITTLEFS.h" + #define HASP_FS LITTLEFS + #endif #elif defined(ARDUINO_ARCH_ESP8266) -// included by default + // included by default + #include + #define HASP_FS LittleFS #endif // ARDUINO_ARCH #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) -#include -#include - -#if HASP_USE_SPIFFS > 0 -#define HASP_FS SPIFFS -#elif HASP_USE_LITTLEFS > 0 -#define HASP_FS LITTLEFS -#endif // HASP_USE + #include + #include #endif // ARDUINO_ARCH #endif // HASP_FILESYSTEM_H \ No newline at end of file diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 10f19abb..f235f265 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -49,7 +49,7 @@ File pFileOut; #define INVERT_COLORS 0 #endif -static void IRAM_ATTR lv_tick_handler(void); +// static void IRAM_ATTR lv_tick_handler(void); static bool guiShowPointer = false; static bool guiBacklightIsOn = true; diff --git a/src/svc/hasp_mdns.cpp b/src/svc/hasp_mdns.cpp index ebced002..5819ac19 100644 --- a/src/svc/hasp_mdns.cpp +++ b/src/svc/hasp_mdns.cpp @@ -4,15 +4,16 @@ #include "hasp_conf.h" #if HASP_USE_MDNS > 0 -#if defined(ARDUINO_ARCH_ESP32) -#include -#elif defined(ARDUINO_ARCH_ESP8266) -#include -// MDNSResponder::hMDNSService hMDNSService; -#endif + #if defined(ARDUINO_ARCH_ESP32) + #include + #elif defined(ARDUINO_ARCH_ESP8266) + #include + // MDNSResponder::hMDNSService hMDNSService; + #endif -#include "hasp_config.h" -#include "hasp_debug.h" + #include "hasp/hasp.h" + #include "hasp_config.h" + #include "hasp_debug.h" uint8_t mdnsEnabled = true; @@ -31,17 +32,17 @@ void mdnsStart() Log.notice(TAG_MDNS, F("Starting MDNS Responder...")); -#if HASP_USE_MQTT > 0 + #if HASP_USE_MQTT > 0 String hasp2Node = mqttGetNodename(); -#else + #else String hasp2Node = "unknown"; -#endif + #endif // Setup mDNS service discovery if enabled char buffer[32]; - snprintf_P(buffer, sizeof(buffer), PSTR("%u.%u.%u"), HASP_VERSION_MAJOR, HASP_VERSION_MINOR, HASP_VERSION_REVISION); - uint8_t attempt = 0; + haspGetVersion(buffer, sizeof(buffer)); + uint8_t attempt = 0; while(!MDNS.begin(hasp2Node.c_str())) { if(attempt++ >= 3) { Log.error(TAG_MDNS, F("Responder failed to start %s"), hasp2Node.c_str()); @@ -68,19 +69,19 @@ void mdnsStart() void IRAM_ATTR mdnsLoop(void) { -#if defined(ARDUINO_ARCH_ESP8266) + #if defined(ARDUINO_ARCH_ESP8266) if(mdnsEnabled) { MDNS.update(); } -#endif + #endif } void mdnsStop() { return; -#if HASP_USE_MDNS > 0 + #if HASP_USE_MDNS > 0 MDNS.end(); -#endif + #endif } #if HASP_USE_CONFIG > 0