Add morse playback of main menu
This commit is contained in:
parent
3087830bfb
commit
88d16bb073
41
ubitx_ui.cpp
41
ubitx_ui.cpp
@ -347,7 +347,7 @@ void fastTune(){
|
|||||||
//if the btn is down, wait until it is up
|
//if the btn is down, wait until it is up
|
||||||
while(btnDown())
|
while(btnDown())
|
||||||
active_delay(50);
|
active_delay(50);
|
||||||
active_delay(300);
|
active_delay(50);
|
||||||
|
|
||||||
strncpy_P(c,(const char*)F("Fast tune"),sizeof(c));
|
strncpy_P(c,(const char*)F("Fast tune"),sizeof(c));
|
||||||
displayText(c, LAYOUT_MODE_TEXT_X, LAYOUT_MODE_TEXT_Y, LAYOUT_MODE_TEXT_WIDTH, LAYOUT_MODE_TEXT_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND);
|
displayText(c, LAYOUT_MODE_TEXT_X, LAYOUT_MODE_TEXT_Y, LAYOUT_MODE_TEXT_WIDTH, LAYOUT_MODE_TEXT_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND);
|
||||||
@ -361,7 +361,7 @@ void fastTune(){
|
|||||||
//wait until the button is realsed and then return
|
//wait until the button is realsed and then return
|
||||||
while(btnDown())
|
while(btnDown())
|
||||||
active_delay(50);
|
active_delay(50);
|
||||||
active_delay(300);
|
active_delay(50);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,12 +390,22 @@ void enterFreq(){
|
|||||||
btnDraw(&button);
|
btnDraw(&button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while(btnDown())
|
||||||
|
active_delay(50);
|
||||||
|
active_delay(50);
|
||||||
|
|
||||||
int cursor_pos = 0;
|
int cursor_pos = 0;
|
||||||
memset(c, 0, sizeof(c));
|
memset(c, 0, sizeof(c));
|
||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
|
|
||||||
checkCAT();
|
checkCAT();
|
||||||
|
if(btnDown()){
|
||||||
|
while(btnDown())
|
||||||
|
active_delay(50);
|
||||||
|
active_delay(50);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if(!readTouch())
|
if(!readTouch())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -427,8 +437,6 @@ void enterFreq(){
|
|||||||
}
|
}
|
||||||
saveVFOs();
|
saveVFOs();
|
||||||
}
|
}
|
||||||
guiUpdate();
|
|
||||||
return;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,8 +451,6 @@ void enterFreq(){
|
|||||||
}
|
}
|
||||||
case KEYS_CANCEL:
|
case KEYS_CANCEL:
|
||||||
{
|
{
|
||||||
guiUpdate();
|
|
||||||
return;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEYS_0:
|
case KEYS_0:
|
||||||
@ -478,6 +484,9 @@ void enterFreq(){
|
|||||||
while(readTouch())
|
while(readTouch())
|
||||||
checkCAT();
|
checkCAT();
|
||||||
} // end of event loop : while(1)
|
} // end of event loop : while(1)
|
||||||
|
|
||||||
|
guiUpdate();
|
||||||
|
enc_read();//clear out any tuner turning that happened during entry
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawCWStatus(){
|
void drawCWStatus(){
|
||||||
@ -961,12 +970,13 @@ void doCommands(){
|
|||||||
active_delay(50);
|
active_delay(50);
|
||||||
active_delay(50); //debounce
|
active_delay(50); //debounce
|
||||||
|
|
||||||
|
Button button;
|
||||||
|
memcpy_P(&button, &(btn_set[select/10]), sizeof(Button));
|
||||||
|
morseLetter(button.morse);
|
||||||
|
|
||||||
while (true){
|
while (true){
|
||||||
//check if the knob's button was pressed
|
//check if the knob's button was pressed
|
||||||
if (btnDown()){
|
if (btnDown()){
|
||||||
Button button;
|
|
||||||
memcpy_P(&button, &(btn_set[select/10]), sizeof(Button));
|
|
||||||
|
|
||||||
doCommand(&button);
|
doCommand(&button);
|
||||||
|
|
||||||
//unfocus the buttons
|
//unfocus the buttons
|
||||||
@ -999,11 +1009,14 @@ void doCommands(){
|
|||||||
|
|
||||||
if (prev_button == select / 10)
|
if (prev_button == select / 10)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//we are on a new button
|
//we are on a new button
|
||||||
drawFocus(prev_button, COLOR_INACTIVE_BORDER);
|
drawFocus(prev_button, COLOR_INACTIVE_BORDER);
|
||||||
drawFocus(select/10, COLOR_ACTIVE_BORDER);
|
drawFocus(select/10, COLOR_ACTIVE_BORDER);
|
||||||
prev_button = select/10;
|
memcpy_P(&button, &(btn_set[select/10]), sizeof(Button));
|
||||||
|
morseLetter(button.morse);
|
||||||
|
enc_read();//Clear any rotation that was done while the letter was playing
|
||||||
|
prev_button = select/10;
|
||||||
}
|
}
|
||||||
// guiUpdate();
|
// guiUpdate();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user