From f97b519ce9ad6a2c3d7a151a48b4758f8b9486e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Bro=C3=9Fwick?= Date: Sat, 29 Aug 2020 12:39:59 +0200 Subject: [PATCH] allows lvgl to use psram if it is available lvgl consumes relatively much memory during intensive use. the change allows lvgl to use psram and saves internal ram. --- src/lv_conf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lv_conf.h b/src/lv_conf.h index 9f53b4f..67c1466 100644 --- a/src/lv_conf.h +++ b/src/lv_conf.h @@ -93,7 +93,11 @@ typedef int16_t lv_coord_t; # define LV_MEM_AUTO_DEFRAG 1 #else /*LV_MEM_CUSTOM*/ # define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ +#if defined(BOARD_HAS_PSRAM) +# define LV_MEM_CUSTOM_ALLOC ps_malloc /*Wrapper to malloc*/ +#else # define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/ +#endif # define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/ #endif /*LV_MEM_CUSTOM*/