From d8c0ab1c44d97380817b62b6f9f4e83afda33da1 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Fri, 29 Dec 2023 10:58:54 +0100 Subject: [PATCH] Dropped support for 20kHz bandwidth Dropped support for 20kHz bandwith in rtx code and radio drivers. This option is supported only by MDx radios and so far is not being used at all. --- openrtx/include/rtx/rtx.h | 3 +-- openrtx/src/core/voicePromptUtils.c | 2 +- openrtx/src/ui/default/ui.c | 2 +- openrtx/src/ui/default/ui_main.c | 2 -- openrtx/src/ui/default/ui_menu.c | 3 --- openrtx/src/ui/module17/ui_main.c | 2 -- platform/drivers/CPS/cps_io_native_MD3x0.c | 2 +- platform/drivers/CPS/cps_io_native_MD9600.c | 2 +- platform/drivers/CPS/cps_io_native_MDUV3x0.c | 2 +- platform/drivers/baseband/radio_GDx.cpp | 1 - platform/drivers/baseband/radio_MD3x0.cpp | 7 ------- platform/drivers/baseband/radio_UV3x0.cpp | 1 - platform/drivers/baseband/radio_ttwrplus.cpp | 1 - 13 files changed, 6 insertions(+), 24 deletions(-) diff --git a/openrtx/include/rtx/rtx.h b/openrtx/include/rtx/rtx.h index 2feb09be..6694bef0 100644 --- a/openrtx/include/rtx/rtx.h +++ b/openrtx/include/rtx/rtx.h @@ -75,8 +75,7 @@ rtxStatus_t; enum bandwidth { BW_12_5 = 0, /**< 12.5kHz bandwidth */ - BW_20 = 1, /**< 20kHz bandwidth */ - BW_25 = 2 /**< 25kHz bandwidth */ + BW_25 = 1 /**< 25kHz bandwidth */ }; /** diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index 31cd96de..ad6b2ee1 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -159,7 +159,7 @@ void vp_announceBandwidth(const uint8_t bandwidth, const vpQueueFlags_t flags) vp_queuePrompt(PROMPT_BANDWIDTH); } - char* bandwidths[] = {"12.5", "20", "25"}; + char* bandwidths[] = {"12.5", "25"}; vp_queueString(bandwidths[bandwidth], vpAnnounceCommonSymbols); vp_queuePrompt(PROMPT_KILOHERTZ); playIfNeeded(flags); diff --git a/openrtx/src/ui/default/ui.c b/openrtx/src/ui/default/ui.c index 451abe8b..0539be41 100644 --- a/openrtx/src/ui/default/ui.c +++ b/openrtx/src/ui/default/ui.c @@ -977,7 +977,7 @@ static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx) if(state.channel.mode == OPMODE_FM) { state.channel.bandwidth++; - state.channel.bandwidth %= 3; + state.channel.bandwidth %= 2; *sync_rtx = true; vp_announceBandwidth(state.channel.bandwidth, queueFlags); } diff --git a/openrtx/src/ui/default/ui_main.c b/openrtx/src/ui/default/ui_main.c index fe8a7089..641b2668 100644 --- a/openrtx/src/ui/default/ui_main.c +++ b/openrtx/src/ui/default/ui_main.c @@ -83,8 +83,6 @@ void _ui_drawModeInfo(ui_state_t* ui_state) // Get Bandwidth string if(last_state.channel.bandwidth == BW_12_5) sniprintf(bw_str, 8, "NFM"); - else if(last_state.channel.bandwidth == BW_20) - sniprintf(bw_str, 8, "FM20"); else if(last_state.channel.bandwidth == BW_25) sniprintf(bw_str, 8, "FM"); diff --git a/openrtx/src/ui/default/ui_menu.c b/openrtx/src/ui/default/ui_menu.c index e530bd78..ac6060e9 100644 --- a/openrtx/src/ui/default/ui_menu.c +++ b/openrtx/src/ui/default/ui_menu.c @@ -1151,9 +1151,6 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state) case BW_12_5: sniprintf(bw_str, 12, " BW 12.5"); break; - case BW_20: - sniprintf(bw_str, 12, " BW 20 "); - break; case BW_25: sniprintf(bw_str, 12, " BW 25 "); break; diff --git a/openrtx/src/ui/module17/ui_main.c b/openrtx/src/ui/module17/ui_main.c index 74cdf1ac..eef959f5 100644 --- a/openrtx/src/ui/module17/ui_main.c +++ b/openrtx/src/ui/module17/ui_main.c @@ -69,8 +69,6 @@ void _ui_drawModeInfo(ui_state_t* ui_state) // Get Bandwidth string if(last_state.channel.bandwidth == BW_12_5) snprintf(bw_str, 8, "12.5"); - else if(last_state.channel.bandwidth == BW_20) - snprintf(bw_str, 8, "20"); else if(last_state.channel.bandwidth == BW_25) snprintf(bw_str, 8, "25"); // Get encdec string diff --git a/platform/drivers/CPS/cps_io_native_MD3x0.c b/platform/drivers/CPS/cps_io_native_MD3x0.c index 5ab4ade6..cb0216d3 100644 --- a/platform/drivers/CPS/cps_io_native_MD3x0.c +++ b/platform/drivers/CPS/cps_io_native_MD3x0.c @@ -75,7 +75,7 @@ int cps_readChannel(channel_t *channel, uint16_t pos) W25Qx_sleep(); channel->mode = chData.channel_mode; - channel->bandwidth = chData.bandwidth; + channel->bandwidth = (chData.bandwidth == 0) ? 0 : 1; // Consider 20kHz as 25kHz channel->rx_only = chData.rx_only; channel->power = ((chData.power == 1) ? 5000 : 1000); // 5W or 1W channel->rx_frequency = bcdToBin(chData.rx_frequency) * 10; diff --git a/platform/drivers/CPS/cps_io_native_MD9600.c b/platform/drivers/CPS/cps_io_native_MD9600.c index a2208743..9968f257 100644 --- a/platform/drivers/CPS/cps_io_native_MD9600.c +++ b/platform/drivers/CPS/cps_io_native_MD9600.c @@ -53,7 +53,7 @@ static int _readChannelAtAddress(channel_t *channel, uint32_t addr) if(wcslen((wchar_t *) chData.name) == 0) return -1; channel->mode = chData.channel_mode; - channel->bandwidth = chData.bandwidth; + channel->bandwidth = (chData.bandwidth == 0) ? 0 : 1; // Consider 20kHz as 25kHz channel->rx_only = chData.rx_only; channel->rx_frequency = bcdToBin(chData.rx_frequency) * 10; channel->tx_frequency = bcdToBin(chData.tx_frequency) * 10; diff --git a/platform/drivers/CPS/cps_io_native_MDUV3x0.c b/platform/drivers/CPS/cps_io_native_MDUV3x0.c index c2b2a473..e55090ea 100644 --- a/platform/drivers/CPS/cps_io_native_MDUV3x0.c +++ b/platform/drivers/CPS/cps_io_native_MDUV3x0.c @@ -51,7 +51,7 @@ static int _readChannelAtAddress(channel_t *channel, uint32_t addr) if(wcslen((wchar_t *) chData.name) == 0) return -1; channel->mode = chData.channel_mode; - channel->bandwidth = chData.bandwidth; + channel->bandwidth = (chData.bandwidth == 0) ? 0 : 1; // Consider 20kHz as 25kHz channel->rx_only = chData.rx_only; channel->rx_frequency = bcdToBin(chData.rx_frequency) * 10; channel->tx_frequency = bcdToBin(chData.tx_frequency) * 10; diff --git a/platform/drivers/baseband/radio_GDx.cpp b/platform/drivers/baseband/radio_GDx.cpp index 88ed4dce..62681190 100644 --- a/platform/drivers/baseband/radio_GDx.cpp +++ b/platform/drivers/baseband/radio_GDx.cpp @@ -348,7 +348,6 @@ void radio_updateConfiguration() at1846s.setTxDeviation(calData.data[currTxBand].mixGainNarrowband); break; - case BW_20: case BW_25: at1846s.setBandwidth(AT1846S_BW::_25); at1846s.setTxDeviation(calData.data[currTxBand].mixGainWideband); diff --git a/platform/drivers/baseband/radio_MD3x0.cpp b/platform/drivers/baseband/radio_MD3x0.cpp index 96c304b5..7d454060 100644 --- a/platform/drivers/baseband/radio_MD3x0.cpp +++ b/platform/drivers/baseband/radio_MD3x0.cpp @@ -67,13 +67,6 @@ void _setBandwidth(const enum bandwidth bw) C5000.setModFactor(0x1E); break; - case BW_20: - #ifndef MDx_ENABLE_SWD - gpio_setPin(WN_SW); - #endif - C5000.setModFactor(0x30); - break; - case BW_25: #ifndef MDx_ENABLE_SWD gpio_setPin(WN_SW); diff --git a/platform/drivers/baseband/radio_UV3x0.cpp b/platform/drivers/baseband/radio_UV3x0.cpp index d93ac6a2..d2330258 100644 --- a/platform/drivers/baseband/radio_UV3x0.cpp +++ b/platform/drivers/baseband/radio_UV3x0.cpp @@ -346,7 +346,6 @@ void radio_updateConfiguration() at1846s.setBandwidth(AT1846S_BW::_12P5); break; - case BW_20: case BW_25: at1846s.setBandwidth(AT1846S_BW::_25); break; diff --git a/platform/drivers/baseband/radio_ttwrplus.cpp b/platform/drivers/baseband/radio_ttwrplus.cpp index 6edca8a8..a1191417 100644 --- a/platform/drivers/baseband/radio_ttwrplus.cpp +++ b/platform/drivers/baseband/radio_ttwrplus.cpp @@ -161,7 +161,6 @@ void radio_updateConfiguration() at1846s.setBandwidth(AT1846S_BW::_12P5); break; - case BW_20: case BW_25: at1846s.setBandwidth(AT1846S_BW::_25); break;