From b061084f1f8869bf2cac5ef78ea0d01529e8198c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20Degerf=C3=A4lt?= Date: Mon, 24 Jun 2019 17:55:37 +0200 Subject: [PATCH] Fixed som redraw issues --- NuEVI/menu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/NuEVI/menu.cpp b/NuEVI/menu.cpp index afde514..cb88b0d 100644 --- a/NuEVI/menu.cpp +++ b/NuEVI/menu.cpp @@ -961,11 +961,11 @@ static bool updatePage(const MenuPage *page, KeyState &input, uint32_t timeNow) display.setTextColor(WHITE); if(page->flags & EMenuPageCustom) { - auto custom = (const MenuPageCustom*)page; + const MenuPageCustom* custom = (const MenuPageCustom*)page; return custom->menuUpdateFunc(input, timeNow); } - bool redraw = false; + bool redraw = stateFirstRun; if (stateFirstRun) { drawMenu(page); @@ -1050,7 +1050,7 @@ bool adjustPageUpdate(KeyState &input, uint32_t timeNow) { static bool patchPageUpdate(KeyState& input, uint32_t timeNow) { - bool redraw = false; + bool redraw = stateFirstRun; if (stateFirstRun) { display.ssd1306_command(SSD1306_DISPLAYON); @@ -1129,14 +1129,14 @@ static bool patchPageUpdate(KeyState& input, uint32_t timeNow) { break; case BTN_MENU+BTN_ENTER: - midiPanic(); display.clearDisplay(); display.setTextSize(2); display.setCursor(35,15); display.println("DON'T"); display.setCursor(35,30); display.println("PANIC"); - redraw = true; + display.display(); // call display explicitly _before_ we call midiPanic + midiPanic(); break; case BTN_MENU+BTN_ENTER+BTN_UP+BTN_DOWN: @@ -1200,7 +1200,7 @@ static bool idlePageUpdate(KeyState& __unused input, uint32_t __unused timeNow) stateFirstRun = 1; } else { display.ssd1306_command(SSD1306_DISPLAYON); - menuState= MAIN_MENU; + menuState = MAIN_MENU; stateFirstRun = 1; } break;