Workaround "clearpage all" crashing on PC build

This commit is contained in:
Kuba Szczodrzyński 2024-02-12 18:20:00 +01:00
parent 9b3c88492c
commit b0969892fd
No known key found for this signature in database
GPG Key ID: 43037AC62A600562

View File

@ -967,7 +967,14 @@ void dispatch_page(const char*, const char* payload, uint8_t source)
void dispatch_clear_page(const char*, const char* page, uint8_t source)
{
if(!strcasecmp(page, "all")) {
#if !HASP_TARGET_PC
hasp_init();
#else
// workaround for "clearpage all" deadlocking or crashing on PC build (when called from non-LVGL thread)
for(uint8_t pageid = 0; pageid <= HASP_NUM_PAGES; pageid++) {
haspPages.clear(pageid);
}
#endif
return;
}