From 8772e289070ec59521d1cdf44934b4c076582673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20Degerf=C3=A4lt?= Date: Fri, 21 Jun 2019 21:50:46 +0200 Subject: [PATCH] Pass button state instead of accessing global variable --- NuEVI/menu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NuEVI/menu.cpp b/NuEVI/menu.cpp index 2f7412a..ea142fe 100644 --- a/NuEVI/menu.cpp +++ b/NuEVI/menu.cpp @@ -1150,11 +1150,11 @@ static bool updateMenuPage( const MenuPage &page, uint32_t timeNow ) { } //*********************************************************** -static void checkForPatchView() +static void checkForPatchView(int buttons) { int trills = readTrills(); - switch (deumButtonState){ + switch (buttons){ case BTN_MENU+BTN_DOWN: break; @@ -1501,7 +1501,7 @@ void menu() { bool hadButtons = buttonPressedAndNotUsed; redraw |= updateMenuPage( *currentPage, timeNow ); if (hadButtons) - checkForPatchView(); + checkForPatchView(deumButtonState); } } else if (state == ROTATOR_MENU) { // ROTATOR MENU HERE <<<<<<<<<<<<<<< if (stateFirstRun) { @@ -1605,7 +1605,7 @@ void menu() { bool hadButtons = buttonPressedAndNotUsed; redraw |= updateMenuPage( *currentPage, timeNow ); if (hadButtons) - checkForPatchView(); + checkForPatchView(deumButtonState); } // end rotator menu