From 5cd7a09797dc90ff99eeb678713250cee75d72cf Mon Sep 17 00:00:00 2001 From: Mark Thompson <129641948+NotherNgineer@users.noreply.github.com> Date: Wed, 11 Oct 2023 00:45:45 -0500 Subject: [PATCH] Disable display scroll before showing fault debug message (#1482) --- firmware/application/debug.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/firmware/application/debug.cpp b/firmware/application/debug.cpp index e0f1a6a8..57a2281f 100644 --- a/firmware/application/debug.cpp +++ b/firmware/application/debug.cpp @@ -57,6 +57,9 @@ uint32_t fault_address{0}; void draw_guru_meditation_header(uint8_t source, const char* hint) { Painter painter; + // disable scroll in case a waterfall/spectrum display was active (scroll would mess up the fault display) + portapack::display.scroll_disable(); + painter.fill_rectangle( {0, 0, portapack::display.width(), portapack::display.height()}, Color::red()); @@ -134,6 +137,10 @@ void runtime_error(uint8_t source) { led.off(); + // wait for DFU button release if pressed, so we don't immediately jump into stack dump + while (swizzled_switches() & (1 << (int)Switch::Dfu)) + ; + while (true) { volatile size_t n = 1000000U; while (n--) @@ -243,10 +250,6 @@ void draw_stack_dump() { p = &__process_stack_base__; break; } - - // If SEL button pressed, try writing to file (likely to hang in fault condition but heh) - if (switches & (1 << (int)Switch::Sel)) - stack_dump(); } // clear screen to allow new range to be displayed, if we're not at the end