mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 13:16:45 +00:00
Memory improvements
This commit is contained in:
parent
7d286c24bc
commit
6299927121
@ -90,10 +90,8 @@ 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)
|
if(charBitmap_p) lv_mem_free(charBitmap_p);
|
||||||
lv_mem_realloc(charBitmap_p, size);
|
charBitmap_p = (uint8_t *)lv_mem_alloc(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
|
||||||
}
|
}
|
||||||
|
10
src/hasp.cpp
10
src/hasp.cpp
@ -608,7 +608,6 @@ void IRAM_ATTR btn_event_handler(lv_obj_t * obj, lv_event_t event)
|
|||||||
{
|
{
|
||||||
uint8_t eventid;
|
uint8_t eventid;
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
snprintf(buffer, sizeof(buffer), PSTR("HASP: "));
|
|
||||||
|
|
||||||
switch(event) {
|
switch(event) {
|
||||||
case LV_EVENT_PRESSED:
|
case LV_EVENT_PRESSED:
|
||||||
@ -643,17 +642,14 @@ void IRAM_ATTR btn_event_handler(lv_obj_t * obj, lv_event_t event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case LV_EVENT_VALUE_CHANGED:
|
case LV_EVENT_VALUE_CHANGED:
|
||||||
strcat_P(buffer, PSTR("Value Changed"));
|
Log.warning(TAG_HASP, F("Value changed Event %d occured"), event);
|
||||||
Log.notice(TAG_HASP, buffer);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case LV_EVENT_DELETE:
|
case LV_EVENT_DELETE:
|
||||||
strcat_P(buffer, PSTR("Object deleted"));
|
Log.warning(TAG_HASP, F("Object deleted Event %d occured"), event);
|
||||||
Log.notice(TAG_HASP, buffer, event);
|
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
strcat_P(buffer, PSTR("HASP : Unknown Event occured"));
|
Log.warning(TAG_HASP, F("Unknown Event %d occured"), event);
|
||||||
Log.warning(TAG_HASP, buffer, event);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user