From 79a37620c2ef5ab70095d3ec0b7e8bc6fa1c0824 Mon Sep 17 00:00:00 2001 From: Reed Nightingale Date: Sun, 9 Feb 2020 16:31:24 -0800 Subject: [PATCH] Play morse when selecting --- menu_main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/menu_main.cpp b/menu_main.cpp index 4f7d71d..27e18b8 100644 --- a/menu_main.cpp +++ b/menu_main.cpp @@ -121,8 +121,8 @@ MenuReturn_e runMainMenu(const ButtonPress_e tuner_button, else if(ButtonPress_e::NotPressed != touch_button){ //We treat long and short presses the same, so no need to have a switch - Button b; - if(findPressedButton(mainMenuButtons,MAIN_MENU_NUM_BUTTONS,&b,touch_point)){ + Button button; + if(findPressedButton(mainMenuButtons,MAIN_MENU_NUM_BUTTONS,&button,touch_point)){ //TODO: activate button } else{ @@ -137,6 +137,15 @@ MenuReturn_e runMainMenu(const ButtonPress_e tuner_button, const uint8_t new_select = mainMenuSelectedItemRaw/MENU_KNOB_COUNTS_PER_ITEM; if(prev_select != new_select){ movePuck(&mainMenuButtons[prev_select],&mainMenuButtons[new_select]);//TODO + morseLetter(mainMenuButtons[new_select].morse); + int8_t morse_status = 0; + mainMenuButtons[new_select].morse_status(morse_status); + if(morse_status < 0){ + morseBool(false); + } + else if(morse_status > 0){ + morseBool(true); + } } } else{