mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2025-02-21 06:57:27 -05:00
Auto-update sideband mode based on keyed-in frequency
This commit is contained in:
parent
20a4577ed2
commit
a8910e1ba2
25
ubitx_ui.cpp
25
ubitx_ui.cpp
@ -415,16 +415,29 @@ void enterFreq(){
|
|||||||
switch(button.id){
|
switch(button.id){
|
||||||
case KEYS_OK:
|
case KEYS_OK:
|
||||||
{
|
{
|
||||||
long freq = atol(c);
|
long new_freq = atol(c);
|
||||||
if((LOWEST_FREQ/1000 <= freq) && (freq <= HIGHEST_FREQ/1000)){
|
if((LOWEST_FREQ/1000 <= new_freq) && (new_freq <= HIGHEST_FREQ/1000)){
|
||||||
freq *= 1000L;
|
new_freq *= 1000L;
|
||||||
setFrequency(freq);
|
|
||||||
|
long prev_freq = GetActiveVfoFreq();
|
||||||
|
//Transition from below to above the traditional threshold for USB
|
||||||
|
if(prev_freq < THRESHOLD_USB_LSB && new_freq >= THRESHOLD_USB_LSB){
|
||||||
|
SetActiveVfoMode(VfoMode_e::VFO_MODE_USB);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Transition from aboveo to below the traditional threshold for USB
|
||||||
|
if(prev_freq >= THRESHOLD_USB_LSB && new_freq < THRESHOLD_USB_LSB){
|
||||||
|
SetActiveVfoMode(VfoMode_e::VFO_MODE_LSB);
|
||||||
|
}
|
||||||
|
|
||||||
if (VFO_A == globalSettings.activeVfo){
|
if (VFO_A == globalSettings.activeVfo){
|
||||||
globalSettings.vfoA.frequency = freq;
|
globalSettings.vfoA.frequency = new_freq;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
globalSettings.vfoB.frequency = freq;
|
globalSettings.vfoB.frequency = new_freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setFrequency(new_freq);
|
||||||
saveVFOs();
|
saveVFOs();
|
||||||
}
|
}
|
||||||
guiUpdate();
|
guiUpdate();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user