mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +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)
|
||||
{
|
||||
if(size > _lv_mem_get_size(charBitmap_p)) {
|
||||
if(charBitmap_p)
|
||||
lv_mem_realloc(charBitmap_p, size);
|
||||
else
|
||||
charBitmap_p = (uint8_t *)lv_mem_alloc(size);
|
||||
if(charBitmap_p) lv_mem_free(charBitmap_p);
|
||||
charBitmap_p = (uint8_t *)lv_mem_alloc(size);
|
||||
}
|
||||
_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;
|
||||
char buffer[64];
|
||||
snprintf(buffer, sizeof(buffer), PSTR("HASP: "));
|
||||
|
||||
switch(event) {
|
||||
case LV_EVENT_PRESSED:
|
||||
@ -643,17 +642,14 @@ void IRAM_ATTR btn_event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
return;
|
||||
|
||||
case LV_EVENT_VALUE_CHANGED:
|
||||
strcat_P(buffer, PSTR("Value Changed"));
|
||||
Log.notice(TAG_HASP, buffer);
|
||||
Log.warning(TAG_HASP, F("Value changed Event %d occured"), event);
|
||||
return;
|
||||
|
||||
case LV_EVENT_DELETE:
|
||||
strcat_P(buffer, PSTR("Object deleted"));
|
||||
Log.notice(TAG_HASP, buffer, event);
|
||||
Log.warning(TAG_HASP, F("Object deleted Event %d occured"), event);
|
||||
return;
|
||||
default:
|
||||
strcat_P(buffer, PSTR("HASP : Unknown Event occured"));
|
||||
Log.warning(TAG_HASP, buffer, event);
|
||||
Log.warning(TAG_HASP, F("Unknown Event %d occured"), event);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user