Add endSelector util

This commit is contained in:
Reed Nightingale 2020-02-09 21:59:15 -08:00
parent 5c04e23504
commit cc763a0dce
3 changed files with 12 additions and 1 deletions

View File

@ -118,11 +118,15 @@ MenuReturn_e runMainMenu(const ButtonPress_e tuner_button,
{
if(mainMenuSelecting){
uint8_t menu_index = mainMenuSelectedItemRaw/MENU_KNOB_COUNTS_PER_ITEM;
Button button;
memcpy_P(&button,&mainMenuButtons[menu_index],sizeof(button));
endSelector(&button);
//TODO: activate button
Serial.print(F("Select button "));
Serial.print(menu_index);
Serial.print(F(":"));
Serial.println(mainMenuButtons[menu_index].text);
Serial.println(button.text);
}
else{
initSelector(&mainMenuSelectedItemRaw,

View File

@ -119,3 +119,8 @@ void adjustSelector(int16_t *const raw_select_val_in_out,
playButtonMorse(&new_button,play_type);
}
}
void endSelector(const Button *const button)
{
movePuck(button,nullptr);
}

View File

@ -31,3 +31,5 @@ void adjustSelector(int16_t *const raw_select_val_in_out,
const Button *const buttons,
const uint8_t num_buttons,
const MorsePlaybackType_e);
void endSelector(const Button *const button);