mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-26 20:56:37 +00:00
Merge branch '0.1.0-dev' of https://github.com/fvanroie/hasp-lvgl into 0.1.0-dev
This commit is contained in:
commit
1df6a9d2eb
@ -47,6 +47,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <FS.h> // Include the SPIFFS library
|
#include <FS.h> // Include the SPIFFS library
|
||||||
#include "hasp_spiffs.h"
|
#include "hasp_spiffs.h"
|
||||||
|
|
||||||
|
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
//#include "lv_zifont.h"
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HASP_USE_EEPROM>0
|
#if HASP_USE_EEPROM>0
|
||||||
|
@ -42,7 +42,8 @@ monitor_speed = 115200
|
|||||||
; -- Shared library dependencies in all environments
|
; -- Shared library dependencies in all environments
|
||||||
lib_deps =
|
lib_deps =
|
||||||
;lvgl@7.0.0 ; Not in library yet
|
;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
|
;TFT_eSPI@^1.4.20 ; Tft SPI drivers
|
||||||
PubSubClient@^2.7.0 ; MQTT client
|
PubSubClient@^2.7.0 ; MQTT client
|
||||||
ArduinoJson@^6.15.1,>6.15.0 ; needs at least 6.15.0
|
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
|
-I include ; include lv_conf.h and hasp_conf.h
|
||||||
${override.build_flags}
|
${override.build_flags}
|
||||||
|
|
||||||
|
src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<stm32f4/>
|
||||||
|
|
||||||
; -- Platform specific build flags
|
; -- Platform specific build flags
|
||||||
[flags]
|
[flags]
|
||||||
esp8266_flags=
|
esp8266_flags=
|
||||||
@ -130,6 +133,7 @@ monitor_port = COM7 ; To change the port, use platform_override.ini
|
|||||||
build_flags =
|
build_flags =
|
||||||
${env.build_flags}
|
${env.build_flags}
|
||||||
${flags.stm32_flags}
|
${flags.stm32_flags}
|
||||||
|
-I include/stm32f4
|
||||||
; -- TFT_eSPI build options ------------------------
|
; -- TFT_eSPI build options ------------------------
|
||||||
${lcd.lolin24}
|
${lcd.lolin24}
|
||||||
;-D TFT_MISO=PB4 ;Default
|
;-D TFT_MISO=PB4 ;Default
|
||||||
@ -148,6 +152,9 @@ lib_deps =
|
|||||||
STM32duino LwIP@^2.1.2
|
STM32duino LwIP@^2.1.2
|
||||||
STM32duino STM32Ethernet@^1.0.5
|
STM32duino STM32Ethernet@^1.0.5
|
||||||
|
|
||||||
|
src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<lv_lib_zifont/> +<stm32f4/>
|
||||||
|
|
||||||
|
|
||||||
;***************************************************
|
;***************************************************
|
||||||
; Generic ESP32 build
|
; Generic ESP32 build
|
||||||
;***************************************************
|
;***************************************************
|
||||||
|
21
src/hasp.cpp
21
src/hasp.cpp
@ -8,22 +8,10 @@
|
|||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include "lv_conf.h"
|
#include "lv_conf.h"
|
||||||
|
#include "hasp_conf.h"
|
||||||
|
|
||||||
//#include "../lib/lvgl/src/lv_widgets/lv_roller.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 "lv_fs_if.h"
|
||||||
#include "hasp_debug.h"
|
#include "hasp_debug.h"
|
||||||
#include "hasp_config.h"
|
#include "hasp_config.h"
|
||||||
@ -36,11 +24,6 @@
|
|||||||
#include "hasp_attribute.h"
|
#include "hasp_attribute.h"
|
||||||
#include "hasp.h"
|
#include "hasp.h"
|
||||||
|
|
||||||
#include "hasp_conf.h"
|
|
||||||
#if HASP_USE_MQTT
|
|
||||||
#include "hasp_mqtt.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//#if LV_USE_HASP
|
//#if LV_USE_HASP
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
@ -377,6 +360,7 @@ void haspSetup()
|
|||||||
/* ********** Font Initializations ********** */
|
/* ********** Font Initializations ********** */
|
||||||
defaultFont = LV_FONT_DEFAULT; // Use default font
|
defaultFont = LV_FONT_DEFAULT; // Use default font
|
||||||
#if HASP_USE_SPIFFS > 0
|
#if HASP_USE_SPIFFS > 0
|
||||||
|
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
||||||
lv_zifont_init();
|
lv_zifont_init();
|
||||||
|
|
||||||
if(lv_zifont_font_init(&haspFonts[0], haspZiFontPath, 24) != 0) {
|
if(lv_zifont_font_init(&haspFonts[0], haspZiFontPath, 24) != 0) {
|
||||||
@ -384,6 +368,7 @@ void haspSetup()
|
|||||||
} else {
|
} else {
|
||||||
defaultFont = haspFonts[0];
|
defaultFont = haspFonts[0];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
/* ********** Font Initializations ********** */
|
/* ********** Font Initializations ********** */
|
||||||
|
|
||||||
|
@ -646,13 +646,20 @@ void guiSetup()
|
|||||||
// static lv_color_t * guiVdbBuffer2 = (lv_color_t *)malloc(sizeof(lv_color_t) * guiVDBsize);
|
// 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, guiVdbBuffer2, guiVDBsize);
|
||||||
lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize);
|
lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize);
|
||||||
#else
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
/* allocate on heap */
|
/* allocate on heap */
|
||||||
static lv_disp_buf_t disp_buf;
|
static lv_disp_buf_t disp_buf;
|
||||||
static lv_color_t guiVdbBuffer1[5 * 512u]; // 5 KBytes
|
static lv_color_t guiVdbBuffer1[5 * 512u]; // 5 KBytes
|
||||||
// static lv_color_t guiVdbBuffer2[3 * 1024u]; // 6 KBytes
|
// static lv_color_t guiVdbBuffer2[3 * 1024u]; // 6 KBytes
|
||||||
guiVDBsize = sizeof(guiVdbBuffer1) / sizeof(guiVdbBuffer1[0]);
|
guiVDBsize = sizeof(guiVdbBuffer1) / sizeof(guiVdbBuffer1[0]);
|
||||||
lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize);
|
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
|
#endif
|
||||||
|
|
||||||
/* Initialize PNG decoder */
|
/* Initialize PNG decoder */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user