Fix random upper/lower for TX, bring back TX on last RX

This commit is contained in:
Krzysiek Egzmont
2023-10-09 16:02:57 +02:00
parent 43f4790f5b
commit 4b9147327a
2 changed files with 12 additions and 11 deletions

21
radio.c
View File

@@ -494,13 +494,13 @@ void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)
glitch_close = (glitch_open * 10) / 9; glitch_close = (glitch_open * 10) / 9;
// ensure the 'close' threshold is lower than the 'open' threshold // ensure the 'close' threshold is lower than the 'open' threshold
if (rssi_close == rssi_open && rssi_close > 0) if (rssi_close == rssi_open && rssi_close >= 2)
rssi_close--; rssi_close -= 2;
if (noise_close == noise_open && noise_close < 127) if (noise_close == noise_open && noise_close <= 125)
noise_close++; noise_close += 2;
if (glitch_close == glitch_open && glitch_close < 255) if (glitch_close == glitch_open && glitch_close <= 253)
glitch_close++; glitch_close += 2;
pInfo->SquelchOpenRSSIThresh = (rssi_open > 255) ? 255 : rssi_open; pInfo->SquelchOpenRSSIThresh = (rssi_open > 255) ? 255 : rssi_open;
pInfo->SquelchCloseRSSIThresh = (rssi_close > 255) ? 255 : rssi_close; pInfo->SquelchCloseRSSIThresh = (rssi_close > 255) ? 255 : rssi_close;
pInfo->SquelchOpenNoiseThresh = (noise_open > 127) ? 127 : noise_open; pInfo->SquelchOpenNoiseThresh = (noise_open > 127) ? 127 : noise_open;
@@ -934,12 +934,13 @@ void RADIO_PrepareTX(void)
gDualWatchCountdown_10ms = dual_watch_count_after_tx_10ms; gDualWatchCountdown_10ms = dual_watch_count_after_tx_10ms;
gScheduleDualWatch = false; gScheduleDualWatch = false;
if (gRxVfoIsActive) if (!gRxVfoIsActive)
{ // use the TX vfo { // use the current RX vfo
gEeprom.RX_VFO = gEeprom.TX_VFO; gEeprom.RX_VFO = gEeprom.TX_VFO;
gRxVfo = &gEeprom.VfoInfo[gEeprom.TX_VFO]; gRxVfo = &gEeprom.VfoInfo[gEeprom.TX_VFO];
// gRxVfoIsActive = true; gRxVfoIsActive = true;
} }
gCurrentVfo = gRxVfo;
// let the user see that DW is not active // let the user see that DW is not active
gDualWatchActive = false; gDualWatchActive = false;

View File

@@ -195,7 +195,7 @@ const char gSubMenu_CHAN[3][10] =
const char gSubMenu_XB[3][10] = const char gSubMenu_XB[3][10] =
{ {
"MAIN\nVFO", "RX\nVFO",
"UPPER\nVFO", "UPPER\nVFO",
"LOWER\nVFO" "LOWER\nVFO"
}; };