mirror of
https://github.com/kamilsss655/uv-k5-firmware-custom
synced 2024-11-22 10:18:15 +00:00
Clean up copy-chan-to-vfo
This commit is contained in:
parent
eba4bf9c80
commit
d632698428
45
app/main.c
45
app/main.c
@ -560,45 +560,12 @@ static void MAIN_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
||||
gCssScanMode == CSS_SCAN_MODE_OFF)
|
||||
{ // copy channel to VFO
|
||||
|
||||
int channel = -1;
|
||||
int vfo = -1;
|
||||
const unsigned int vfo = (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) ? gEeprom.RX_CHANNEL : gEeprom.TX_CHANNEL;
|
||||
|
||||
#if 0
|
||||
// copy channel to opposite VFO
|
||||
if (IS_FREQ_CHANNEL(gEeprom.ScreenChannel[0]) &&
|
||||
IS_MR_CHANNEL(gEeprom.ScreenChannel[1]))
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo]))
|
||||
{
|
||||
channel = gEeprom.ScreenChannel[1];
|
||||
vfo = 0;
|
||||
}
|
||||
else
|
||||
if (IS_FREQ_CHANNEL(gEeprom.ScreenChannel[1]) &&
|
||||
IS_MR_CHANNEL(gEeprom.ScreenChannel[0]))
|
||||
{
|
||||
channel = gEeprom.ScreenChannel[0];
|
||||
vfo = 1;
|
||||
}
|
||||
#else
|
||||
// copy channel to same VFO
|
||||
const unsigned int chan = (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) ? gEeprom.RX_CHANNEL : gEeprom.TX_CHANNEL;
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[chan]))
|
||||
{
|
||||
channel = gEeprom.ScreenChannel[chan];
|
||||
vfo = chan;
|
||||
}
|
||||
#endif
|
||||
const unsigned int channel = FREQ_CHANNEL_FIRST + gEeprom.VfoInfo[vfo].Band;
|
||||
|
||||
if (channel >= 0 && vfo >= 0)
|
||||
{ // copy the channel into the VFO
|
||||
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
gEeprom.MrChannel[vfo] = channel;
|
||||
gEeprom.ScreenChannel[vfo] = channel;
|
||||
RADIO_ConfigureChannel(vfo, VFO_CONFIGURE_RELOAD);
|
||||
|
||||
channel = FREQ_CHANNEL_FIRST + gEeprom.VfoInfo[vfo].Band;
|
||||
gEeprom.MrChannel[vfo] = channel;
|
||||
gEeprom.ScreenChannel[vfo] = channel;
|
||||
gEeprom.VfoInfo[vfo].CHANNEL_SAVE = channel;
|
||||
|
||||
@ -606,13 +573,13 @@ static void MAIN_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
||||
gEeprom.TX_CHANNEL = vfo;
|
||||
gEeprom.RX_CHANNEL = vfo;
|
||||
RADIO_SelectVfos();
|
||||
|
||||
RADIO_ApplyOffset(gRxVfo);
|
||||
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
|
||||
|
||||
RADIO_SetupRegisters(true);
|
||||
|
||||
//SETTINGS_SaveChannel(gRxVfo->CHANNEL_SAVE, gEeprom.RX_CHANNEL, gRxVfo, 1);
|
||||
//SETTINGS_SaveChannel(channel, gEeprom.RX_CHANNEL, gRxVfo, 1);
|
||||
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
gUpdateStatus = true;
|
||||
gUpdateDisplay = true;
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user