diff --git a/include/hasp_conf.h b/include/hasp_conf.h index ddcdcc7c..a14b936f 100644 --- a/include/hasp_conf.h +++ b/include/hasp_conf.h @@ -47,6 +47,10 @@ #endif #include // Include the SPIFFS library #include "hasp_spiffs.h" + +#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) +//#include "lv_zifont.h" +#endif #endif #if HASP_USE_EEPROM>0 diff --git a/include/lwipopts.h b/include/stm32f4/lwipopts.h similarity index 100% rename from include/lwipopts.h rename to include/stm32f4/lwipopts.h diff --git a/platformio.ini b/platformio.ini index 20370759..81b7f8d9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -42,7 +42,8 @@ monitor_speed = 115200 ; -- Shared library dependencies in all environments lib_deps = ;lvgl@7.0.0 ; Not in library yet - TFT_eSPI@^2.1.9 ; Tft SPI drivers + https://github.com/netwizeBE/TFT_eSPI.git + ;TFT_eSPI@^2.2.2 ; Tft SPI drivers ;TFT_eSPI@^1.4.20 ; Tft SPI drivers PubSubClient@^2.7.0 ; MQTT client ArduinoJson@^6.15.1,>6.15.0 ; needs at least 6.15.0 @@ -70,6 +71,8 @@ build_flags = -I include ; include lv_conf.h and hasp_conf.h ${override.build_flags} +src_filter = +<*> -<.git/> -<.svn/> - - - - - + ; -- Platform specific build flags [flags] esp8266_flags= @@ -130,6 +133,7 @@ monitor_port = COM7 ; To change the port, use platform_override.ini build_flags = ${env.build_flags} ${flags.stm32_flags} + -I include/stm32f4 ; -- TFT_eSPI build options ------------------------ ${lcd.lolin24} ;-D TFT_MISO=PB4 ;Default @@ -148,6 +152,9 @@ lib_deps = STM32duino LwIP@^2.1.2 STM32duino STM32Ethernet@^1.0.5 +src_filter = +<*> -<.git/> -<.svn/> - - - - - + + + ;*************************************************** ; Generic ESP32 build ;*************************************************** diff --git a/src/hasp.cpp b/src/hasp.cpp index 8f7b8da5..cab2eaeb 100644 --- a/src/hasp.cpp +++ b/src/hasp.cpp @@ -8,22 +8,10 @@ #include "lvgl.h" #include "lv_conf.h" +#include "hasp_conf.h" //#include "../lib/lvgl/src/lv_widgets/lv_roller.h" -#if HASP_USE_SPIFFS > 0 -#if defined(ARDUINO_ARCH_ESP32) -#include "SPIFFS.h" -#endif -#include // Include the SPIFFS library -#endif - -#if HASP_USE_SPIFFS > 0 -#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) -#include "lv_zifont.h" -#endif -#endif - #include "lv_fs_if.h" #include "hasp_debug.h" #include "hasp_config.h" @@ -36,11 +24,6 @@ #include "hasp_attribute.h" #include "hasp.h" -#include "hasp_conf.h" -#if HASP_USE_MQTT -#include "hasp_mqtt.h" -#endif - //#if LV_USE_HASP /********************* @@ -377,6 +360,7 @@ void haspSetup() /* ********** Font Initializations ********** */ defaultFont = LV_FONT_DEFAULT; // Use default font #if HASP_USE_SPIFFS > 0 +#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) lv_zifont_init(); if(lv_zifont_font_init(&haspFonts[0], haspZiFontPath, 24) != 0) { @@ -384,6 +368,7 @@ void haspSetup() } else { defaultFont = haspFonts[0]; } +#endif #endif /* ********** Font Initializations ********** */ diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 23b20183..021b890a 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -646,13 +646,20 @@ void guiSetup() // static lv_color_t * guiVdbBuffer2 = (lv_color_t *)malloc(sizeof(lv_color_t) * guiVDBsize); // lv_disp_buf_init(&disp_buf, guiVdbBuffer1, guiVdbBuffer2, guiVDBsize); lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize); -#else +#elif defined(ARDUINO_ARCH_ESP8266) /* allocate on heap */ static lv_disp_buf_t disp_buf; static lv_color_t guiVdbBuffer1[5 * 512u]; // 5 KBytes // static lv_color_t guiVdbBuffer2[3 * 1024u]; // 6 KBytes guiVDBsize = sizeof(guiVdbBuffer1) / sizeof(guiVdbBuffer1[0]); lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize); +#else + static lv_disp_buf_t disp_buf; + static lv_color_t guiVdbBuffer1[16 * 512u]; // 16 KBytes + static lv_color_t guiVdbBuffer2[16 * 512u]; // 16 KBytes + guiVDBsize = sizeof(guiVdbBuffer1) / sizeof(guiVdbBuffer1[0]); + lv_disp_buf_init(&disp_buf, guiVdbBuffer1, guiVdbBuffer2, guiVDBsize); + //lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize); #endif /* Initialize PNG decoder */