nakamochi / ndg

nakamochi daemon and gui source code
https://nakamochi.io
MIT License
2 stars 1 forks source link

set LV_ASSERT_HANDLER to something user friendly #6

Open x1ddos opened 1 month ago

x1ddos commented 1 month ago

the handler is invoked when assertions like LV_ASSERT_MALLOC(p) are triggered.

by default, the handler is set to:

#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
#define LV_ASSERT_HANDLER while(1)

which would freeze the ui and is not ideal. maybe set it to display an emergency screen with a shutdown button or something else.

note: if malloc assertion is triggered, it could be impossible to construct a new ui screen.

Stipa88 commented 1 month ago

How to add inside the definition that my function is called. #define LV_ASSERT_HANDLER vMyAssert();