Fixed som redraw issues

This commit is contained in:
Mikael Degerfält 2019-06-24 17:55:37 +02:00
parent 91b2a69d21
commit b061084f1f

View file

@ -961,11 +961,11 @@ static bool updatePage(const MenuPage *page, KeyState &input, uint32_t timeNow)
display.setTextColor(WHITE); display.setTextColor(WHITE);
if(page->flags & EMenuPageCustom) { if(page->flags & EMenuPageCustom) {
auto custom = (const MenuPageCustom*)page; const MenuPageCustom* custom = (const MenuPageCustom*)page;
return custom->menuUpdateFunc(input, timeNow); return custom->menuUpdateFunc(input, timeNow);
} }
bool redraw = false; bool redraw = stateFirstRun;
if (stateFirstRun) { if (stateFirstRun) {
drawMenu(page); drawMenu(page);
@ -1050,7 +1050,7 @@ bool adjustPageUpdate(KeyState &input, uint32_t timeNow) {
static bool patchPageUpdate(KeyState& input, uint32_t timeNow) { static bool patchPageUpdate(KeyState& input, uint32_t timeNow) {
bool redraw = false; bool redraw = stateFirstRun;
if (stateFirstRun) { if (stateFirstRun) {
display.ssd1306_command(SSD1306_DISPLAYON); display.ssd1306_command(SSD1306_DISPLAYON);
@ -1129,14 +1129,14 @@ static bool patchPageUpdate(KeyState& input, uint32_t timeNow) {
break; break;
case BTN_MENU+BTN_ENTER: case BTN_MENU+BTN_ENTER:
midiPanic();
display.clearDisplay(); display.clearDisplay();
display.setTextSize(2); display.setTextSize(2);
display.setCursor(35,15); display.setCursor(35,15);
display.println("DON'T"); display.println("DON'T");
display.setCursor(35,30); display.setCursor(35,30);
display.println("PANIC"); display.println("PANIC");
redraw = true; display.display(); // call display explicitly _before_ we call midiPanic
midiPanic();
break; break;
case BTN_MENU+BTN_ENTER+BTN_UP+BTN_DOWN: 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; stateFirstRun = 1;
} else { } else {
display.ssd1306_command(SSD1306_DISPLAYON); display.ssd1306_command(SSD1306_DISPLAYON);
menuState= MAIN_MENU; menuState = MAIN_MENU;
stateFirstRun = 1; stateFirstRun = 1;
} }
break; break;