Merge branch '0.1.0-dev' of https://github.com/fvanroie/hasp-lvgl into 0.1.0-dev

This commit is contained in:
fvanroie 2020-04-29 17:04:41 +02:00
commit 1df6a9d2eb
5 changed files with 23 additions and 20 deletions

View File

@ -47,6 +47,10 @@
#endif
#include <FS.h> // 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

View File

@ -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/> -<example/> -<examples/> -<test/> -<tests/> -<stm32f4/>
; -- 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/> -<example/> -<examples/> -<test/> -<tests/> -<lv_lib_zifont/> +<stm32f4/>
;***************************************************
; Generic ESP32 build
;***************************************************

View File

@ -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 <FS.h> // 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 ********** */

View File

@ -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 */