Allow the user to define a custom display buffer size

This commit is contained in:
C47D 2021-02-07 18:02:21 -06:00
parent ed013cb14f
commit 82336c2120
2 changed files with 16 additions and 1 deletions

View file

@ -33,7 +33,9 @@ extern "C" {
* color format being used, for RGB565 each pixel needs 2 bytes. * color format being used, for RGB565 each pixel needs 2 bytes.
* When using the mono theme, the display pixels can be represented in one bit, * When using the mono theme, the display pixels can be represented in one bit,
* so the buffer size can be divided by 8, e.g. see SSD1306 display size. */ * so the buffer size can be divided by 8, e.g. see SSD1306 display size. */
#if defined (CONFIG_CUSTOM_DISPLAY_BUFFER_SIZE)
#define DISP_BUF_SIZE CONFIG_CUSTOM_DISPLAY_BUFFER_BYTES
#else
#if defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7789) #if defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7789)
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40) #define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40)
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7735S #elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7735S
@ -70,6 +72,7 @@ extern "C" {
#else #else
#error "No display controller selected" #error "No display controller selected"
#endif #endif
#endif
/********************** /**********************
* TYPEDEFS * TYPEDEFS

View file

@ -328,6 +328,18 @@ menu "LVGL TFT Display controller"
select LV_TFT_DISPLAY_PROTOCOL_SPI select LV_TFT_DISPLAY_PROTOCOL_SPI
endchoice endchoice
config CUSTOM_DISPLAY_BUFFER_SIZE
bool "Use custom display buffer size (bytes)"
help
Enable to use a custom display buffer size.
config CUSTOM_DISPLAY_BUFFER_BYTES
int "Custom buffer size (bytes)"
depends on CUSTOM_DISPLAY_BUFFER_SIZE
default 1024
help
See Display buffer on LVGL docs for more information.
# Select one of the available FT81x configurations. # Select one of the available FT81x configurations.
choice choice
prompt "Select a FT81x configuration." if LV_TFT_DISPLAY_USER_CONTROLLER_FT81X prompt "Select a FT81x configuration." if LV_TFT_DISPLAY_USER_CONTROLLER_FT81X