Tiny adjust menu redraw bug fix

Had forgotten to redraw adjust menu after normal update, it was only redrawn when the sensor pixels were to be updated.
As a bonus I cleaned up some code.
This commit is contained in:
Mikael Degerfält 2019-06-23 11:35:14 +02:00
parent bddbffd51d
commit f2e2b7d33f

View file

@ -11,14 +11,10 @@
#include "settings.h"
#include "numenu.h"
// TODO: Ask Johan the reason for using this..
// static const uint16_t minOffset = 50;
static uint8_t lastDeumButtons = 0;
static uint8_t deumButtonState = 0;
static byte buttonPressedAndNotUsed = 0;
// Allocate some space for cursors
enum CursorIdx {
EMain,
@ -27,16 +23,16 @@ enum CursorIdx {
ERotator,
EVibrato,
// NEVER ADD
// NEVER ADD ANYTHING AFTER THIS, ONLY ABOVE
NUM_CURSORS
};
// Allocate some space for cursors
static byte cursors[CursorIdx::NUM_CURSORS];
static byte offsets[CursorIdx::NUM_CURSORS];
static byte activeSub[CursorIdx::NUM_CURSORS];
byte cursorNow;
static byte FPD = 0;
@ -930,7 +926,6 @@ static bool updateMenuPage( const MenuPage &page, uint32_t timeNow ) {
break;
case BTN_ENTER:
// redraw |= selectMenuOption(cursorPos, page.entries);
redraw |= selectMenuOption(page);
break;
@ -1274,6 +1269,8 @@ void menu() {
// Go back to main menu
state = MAIN_MENU;
stateFirstRun = true;
} else {
redraw = result;
}
if( old_thr != ctouchThrVal) {