capture any exceptions

This commit is contained in:
folkert van heusden 2023-03-27 20:08:47 +02:00
parent f00cbd2997
commit d1083362d7
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -9,6 +9,7 @@
#include "console_esp32.h"
#include "cpu.h"
#include "error.h"
#include "utils.h"
#define NEOPIXELS_PIN 25
@ -104,6 +105,7 @@ void console_esp32::panel_update_thread()
for(;;) {
vTaskDelay(20 / portTICK_RATE_MS);
try {
// note that these are approximately as there's no mutex on the emulation
uint16_t current_PSW = c->getPSW();
int run_mode = current_PSW >> 14;
@ -131,4 +133,11 @@ void console_esp32::panel_update_thread()
pixels.show();
}
catch(std::exception & e) {
put_string_lf(format("Exception in panel thread: %s", e.what()));
}
catch(...) {
put_string_lf("Unknown exception in panel thread");
}
}
}