diff --git a/app/action.c b/app/action.c index 381a1ad..f4639be 100644 --- a/app/action.c +++ b/app/action.c @@ -263,7 +263,7 @@ void ACTION_Scan(bool bRestart) } #ifdef ENABLE_SCAN_RANGES - if (IS_FREQ_CHANNEL(g_tx_vfo->channel_save)) + if (IS_FREQ_CHANNEL(g_tx_vfo->channel_save) && g_eeprom.config.setting.scan_ranges_enable) { const uint32_t freq = g_tx_vfo->freq_config_rx.frequency; FREQUENCY_scan_range(freq, &g_scan_initial_lower, &g_scan_initial_upper, &g_scan_initial_step_size); diff --git a/app/app.c b/app/app.c index 4507ddd..65c83cf 100644 --- a/app/app.c +++ b/app/app.c @@ -673,7 +673,8 @@ static void APP_next_freq(void) // round #ifdef ENABLE_SCAN_RANGES - freq = g_scan_initial_lower + ((((freq - g_scan_initial_lower) + (g_scan_initial_step_size / 2)) / g_scan_initial_step_size) * g_scan_initial_step_size); + if (g_eeprom.config.setting.scan_ranges_enable) + freq = g_scan_initial_lower + ((((freq - g_scan_initial_lower) + (g_scan_initial_step_size / 2)) / g_scan_initial_step_size) * g_scan_initial_step_size); #endif #ifdef ENABLE_SCAN_IGNORE_LIST diff --git a/app/main.c b/app/main.c index 97b188a..1ea4a1e 100644 --- a/app/main.c +++ b/app/main.c @@ -1026,7 +1026,8 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t directio g_scan_initial_step_size = g_tx_vfo->step_freq; #ifdef ENABLE_SCAN_RANGES - //FREQUENCY_scan_range(freq, &g_scan_initial_lower, &g_scan_initial_upper, &g_scan_initial_step_size); + //if (g_eeprom.config.setting.scan_ranges_enable) + // FREQUENCY_scan_range(freq, &g_scan_initial_lower, &g_scan_initial_upper, &g_scan_initial_step_size); #endif } diff --git a/app/menu.c b/app/menu.c index f359e3d..1ab4dfa 100644 --- a/app/menu.c +++ b/app/menu.c @@ -238,7 +238,10 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax) case MENU_BUSY_CHAN_LOCK: case MENU_BEEP: #ifdef ENABLE_KEYLOCK - case MENU_AUTO_KEY_LOCK: + case MENU_AUTO_KEY_LOCK: + #endif + #ifdef ENABLE_SCAN_RANGES + case MENU_SCAN_RANGES: #endif case MENU_S_ADD1: case MENU_S_ADD2: @@ -632,6 +635,12 @@ void MENU_AcceptSetting(void) break; #endif + #ifdef ENABLE_SCAN_RANGES + case MENU_SCAN_RANGES: + g_eeprom.config.setting.scan_ranges_enable = g_sub_menu_selection; + break; + #endif + case MENU_S_ADD1: g_tx_vfo->channel_attributes.scanlist1 = g_sub_menu_selection; SETTINGS_save_chan_attribs_name(g_tx_vfo->channel_save, g_tx_vfo); @@ -1107,6 +1116,12 @@ void MENU_ShowCurrentSetting(void) break; #endif + #ifdef ENABLE_SCAN_RANGES + case MENU_SCAN_RANGES: + g_sub_menu_selection = g_eeprom.config.setting.scan_ranges_enable; + break; + #endif + case MENU_S_ADD1: g_sub_menu_selection = g_tx_vfo->channel_attributes.scanlist1; break; diff --git a/firmware.bin b/firmware.bin index 78c7f8a..ee6dab1 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 57d22fc..45b1dc4 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/frequencies.c b/frequencies.c index 6a533c7..c81e644 100644 --- a/frequencies.c +++ b/frequencies.c @@ -210,6 +210,7 @@ uint32_t FREQUENCY_wrap_to_step_band(uint32_t freq, const uint32_t step_size, co { 5000000, 5400000, 1000}, { 7000000, 7050000, 1250}, {10800000, 11800000, 2500}, +// {11800000, 13700000, 833}, {11800000, 13700000, 2500}, {14400000, 14600000, 1250}, {14400000, 14800000, 1250}, diff --git a/settings.h b/settings.h index 24b12e7..f83fbb4 100644 --- a/settings.h +++ b/settings.h @@ -426,7 +426,10 @@ typedef struct { uint8_t scan_hold_time; // ticks we stay paused for on an RX'ed signal when scanning - uint8_t unused12[7]; // 0xff's + uint8_t scan_ranges_enable:1; // enable/disable auto scan ranges + uint8_t unused11g:7; // 0xff's + + uint8_t unused12[6]; // 0xff's #endif } __attribute__((packed)) setting; diff --git a/ui/menu.c b/ui/menu.c index b9b94b8..59abf40 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -84,6 +84,9 @@ const t_menu_item g_menu_list[] = #endif #ifdef ENABLE_KEYLOCK {"KeyLOC", VOICE_ID_INVALID, MENU_AUTO_KEY_LOCK }, // was "AUTOLk" +#endif +#ifdef ENABLE_SCAN_RANGES + {"S RANG", VOICE_ID_INVALID, MENU_SCAN_RANGES }, #endif {"S ADD1", VOICE_ID_INVALID, MENU_S_ADD1 }, {"S ADD2", VOICE_ID_INVALID, MENU_S_ADD2 }, @@ -765,6 +768,9 @@ void UI_DisplayMenu(void) #ifdef ENABLE_AM_FIX // case MENU_AM_FIX: #endif + #ifdef ENABLE_SCAN_RANGES + case MENU_SCAN_RANGES: + #endif case MENU_S_ADD1: case MENU_S_ADD2: strcpy(str, g_sub_menu_off_on[g_sub_menu_selection]); diff --git a/ui/menu.h b/ui/menu.h index d54a78b..962d87c 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -70,6 +70,9 @@ enum MENU_AUTO_BACKLITE_ON_TX_RX, #ifdef ENABLE_CONTRAST MENU_CONTRAST, +#endif +#ifdef ENABLE_SCAN_RANGES + MENU_SCAN_RANGES, #endif MENU_S_ADD1, MENU_S_ADD2,