From f01b16f4802870588683d149f78fb74b77b9f3ad Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 28 Apr 2020 15:13:00 +0200 Subject: [PATCH 1/7] Add src_filter --- platformio.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platformio.ini b/platformio.ini index 20370759..38ece997 100644 --- a/platformio.ini +++ b/platformio.ini @@ -70,6 +70,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 +132,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 +151,9 @@ lib_deps = STM32duino LwIP@^2.1.2 STM32duino STM32Ethernet@^1.0.5 +src_filter = +<*> -<.git/> -<.svn/> - - - - - + + + ;*************************************************** ; Generic ESP32 build ;*************************************************** From 215ed0798744cd01c29147e98f302f408bc65f2d Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 28 Apr 2020 15:13:25 +0200 Subject: [PATCH 2/7] Add lv_zifont --- include/hasp_conf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hasp_conf.h b/include/hasp_conf.h index ddcdcc7c..d3382322 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 From 95a63dec964aaa13095b4c6db2c76d15f80949a6 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 28 Apr 2020 15:13:45 +0200 Subject: [PATCH 3/7] move lwipopts --- include/{ => stm32f4}/lwipopts.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename include/{ => stm32f4}/lwipopts.h (100%) 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 From 9891dfb612f674c9de6be4079feba9d8ac0adfa6 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 28 Apr 2020 16:15:09 +0200 Subject: [PATCH 4/7] Add Double buffer on stm32 --- src/hasp_gui.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 23b20183..89ba0e4c 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -646,13 +646,19 @@ 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 + lv_disp_buf_init(&disp_buf, guiVdbBuffer1, guiVdbBuffer2, guiVDBsize); + //lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize); #endif /* Initialize PNG decoder */ From 01a668dab98d738ef10a6f0b25646704875f8226 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 28 Apr 2020 16:15:27 +0200 Subject: [PATCH 5/7] Change to forked tft_eSPI --- platformio.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 38ece997..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 From 9ccd3286085e363092a96641d130124c8421bfa0 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 28 Apr 2020 16:15:50 +0200 Subject: [PATCH 6/7] Fix stm32 build issue --- include/hasp_conf.h | 2 +- src/hasp.cpp | 21 +++------------------ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/include/hasp_conf.h b/include/hasp_conf.h index d3382322..a14b936f 100644 --- a/include/hasp_conf.h +++ b/include/hasp_conf.h @@ -49,7 +49,7 @@ #include "hasp_spiffs.h" #if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) -#include "lv_zifont.h" +//#include "lv_zifont.h" #endif #endif 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 ********** */ From 20dff0541ecddb62ae8b32c34e90e5e058d33c59 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Tue, 28 Apr 2020 17:06:15 +0200 Subject: [PATCH 7/7] Fix display error --- src/hasp_gui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 89ba0e4c..021b890a 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -657,6 +657,7 @@ void guiSetup() 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