capture any exceptions
This commit is contained in:
parent
f00cbd2997
commit
d1083362d7
1 changed files with 26 additions and 17 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include "console_esp32.h"
|
#include "console_esp32.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
|
||||||
#define NEOPIXELS_PIN 25
|
#define NEOPIXELS_PIN 25
|
||||||
|
@ -104,6 +105,7 @@ void console_esp32::panel_update_thread()
|
||||||
for(;;) {
|
for(;;) {
|
||||||
vTaskDelay(20 / portTICK_RATE_MS);
|
vTaskDelay(20 / portTICK_RATE_MS);
|
||||||
|
|
||||||
|
try {
|
||||||
// note that these are approximately as there's no mutex on the emulation
|
// note that these are approximately as there's no mutex on the emulation
|
||||||
uint16_t current_PSW = c->getPSW();
|
uint16_t current_PSW = c->getPSW();
|
||||||
int run_mode = current_PSW >> 14;
|
int run_mode = current_PSW >> 14;
|
||||||
|
@ -131,4 +133,11 @@ void console_esp32::panel_update_thread()
|
||||||
|
|
||||||
pixels.show();
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue