mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-26 20:56:37 +00:00
Memory optimization
This commit is contained in:
parent
b4822f64e4
commit
24f783308a
@ -90,8 +90,10 @@ static inline bool openFont(File & file, const char * filename)
|
|||||||
static inline void initCharacterFrame(size_t size)
|
static inline void initCharacterFrame(size_t size)
|
||||||
{
|
{
|
||||||
if(size > _lv_mem_get_size(charBitmap_p)) {
|
if(size > _lv_mem_get_size(charBitmap_p)) {
|
||||||
if(charBitmap_p) lv_mem_free(charBitmap_p);
|
if(charBitmap_p)
|
||||||
charBitmap_p = (uint8_t *)lv_mem_alloc(size);
|
lv_mem_realloc(charBitmap_p, size);
|
||||||
|
else
|
||||||
|
charBitmap_p = (uint8_t *)lv_mem_alloc(size);
|
||||||
}
|
}
|
||||||
_lv_memset_00(charBitmap_p, size); // init the bitmap to white
|
_lv_memset_00(charBitmap_p, size); // init the bitmap to white
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user