Make LV_MEM_SIZE configurable

This commit is contained in:
fvanroie 2020-11-16 17:22:30 +01:00
parent de604fb969
commit a03937988a
2 changed files with 14 additions and 7 deletions

View File

@ -11,7 +11,7 @@
#include <stdint.h> #include <stdint.h>
#ifdef ESP8266 #if defined(ARDUINO_ARCH_ESP8266)
#define LV_HIGH_RESOURCE_MCU 0 #define LV_HIGH_RESOURCE_MCU 0
#endif #endif
@ -76,11 +76,14 @@ typedef int16_t lv_coord_t;
#define LV_MEM_CUSTOM 0 #define LV_MEM_CUSTOM 0
#if LV_MEM_CUSTOM == 0 #if LV_MEM_CUSTOM == 0
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/ /* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
#ifdef ESP8266
# define LV_MEM_SIZE (10 * 1024U) // 12KB
#endif
#ifndef LV_MEM_SIZE #ifndef LV_MEM_SIZE
# define LV_MEM_SIZE (20 * 1024U) // 48KB
#if defined(ARDUINO_ARCH_ESP8266)
# define LV_MEM_SIZE (10 * 1024U) // Minimum 10 Kb
#else
# define LV_MEM_SIZE (20 * 1024U) // 20Kb is much better
#endif
#endif #endif
/* Complier prefix for a big array declaration */ /* Complier prefix for a big array declaration */

View File

@ -85,8 +85,10 @@ extra_scripts = move-rename-firmware.py ; pre:extra_script.py
[flags] [flags]
esp8266_flags= esp8266_flags=
${env.build_flags} ${env.build_flags}
-D HTTP_UPLOAD_BUFLEN=640 ; lower http upload buffer -D HTTP_UPLOAD_BUFLEN=640 ; lower http upload buffer
-D MQTT_MAX_PACKET_SIZE=1024 ; longer PubSubClient messages -D MQTT_MAX_PACKET_SIZE=1024 ; longer PubSubClient messages
; -- lvgl build options -----------------------------
-D LV_MEM_SIZE=(10*1024U) ; 10kB lvgl memory
; -- hasp-lvgl build options ------------------------ ; -- hasp-lvgl build options ------------------------
-D HASP_USE_WIFI=1 -D HASP_USE_WIFI=1
-D HASP_USE_MQTT=1 -D HASP_USE_MQTT=1
@ -104,6 +106,8 @@ esp32_flags=
${env.build_flags} ${env.build_flags}
-D HTTP_UPLOAD_BUFLEN=1024 ; lower http upload buffer -D HTTP_UPLOAD_BUFLEN=1024 ; lower http upload buffer
-D MQTT_MAX_PACKET_SIZE=2048 ; longer PubSubClient messages -D MQTT_MAX_PACKET_SIZE=2048 ; longer PubSubClient messages
; -- lvgl build options -----------------------------
-D LV_MEM_SIZE=(20*1024U) ; 20kB lvgl memory
; -- hasp-lvgl build options ------------------------ ; -- hasp-lvgl build options ------------------------
-D HASP_USE_MQTT=1 -D HASP_USE_MQTT=1
-D HASP_USE_HTTP=1 -D HASP_USE_HTTP=1