diff --git a/app/action.c b/app/action.c index ad8e9f8..1dd248e 100644 --- a/app/action.c +++ b/app/action.c @@ -219,6 +219,10 @@ void ACTION_Scan(bool bRestart) // start scanning + // disable monitor mode + g_monitor_enabled = false; + RADIO_setup_registers(true); + APP_channel_next(true, SCAN_STATE_DIR_FORWARD); g_scan_pause_10ms = 0; // go NOW diff --git a/app/app.c b/app/app.c index cf0d308..fae7ba9 100644 --- a/app/app.c +++ b/app/app.c @@ -668,9 +668,9 @@ void APP_stop_scan(void) static void APP_next_freq(void) { - frequency_band_t new_band; - const frequency_band_t old_band = FREQUENCY_GetBand(g_rx_vfo->freq_config_rx.frequency); - const uint32_t frequency = APP_set_frequency_by_step(g_rx_vfo, g_scan_state_dir); + frequency_band_t new_band; + const frequency_band_t old_band = FREQUENCY_GetBand(g_rx_vfo->freq_config_rx.frequency); + const uint32_t frequency = APP_set_frequency_by_step(g_rx_vfo, g_scan_state_dir); new_band = FREQUENCY_GetBand(frequency); diff --git a/app/main.c b/app/main.c index 4dc64c4..c15f2b6 100644 --- a/app/main.c +++ b/app/main.c @@ -883,9 +883,9 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio if (IS_FREQ_CHANNEL(Channel)) { // step/down in frequency - frequency_band_t new_band; - const frequency_band_t old_band = FREQUENCY_GetBand(g_tx_vfo->freq_config_rx.frequency); - const uint32_t frequency = APP_set_frequency_by_step(g_tx_vfo, Direction); + frequency_band_t new_band; + const frequency_band_t old_band = FREQUENCY_GetBand(g_tx_vfo->freq_config_rx.frequency); + const uint32_t frequency = APP_set_frequency_by_step(g_tx_vfo, Direction); if (FREQUENCY_rx_freq_check(frequency) < 0) { // frequency not allowed @@ -893,12 +893,17 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio return; } + // compute the frequency band for the frequency new_band = FREQUENCY_GetBand(frequency); + // save the new frequency into the VFO g_tx_vfo->freq_config_rx.frequency = frequency; // find the first channel that contains this frequency - // currently takes to long to scan all the channels + // + // this currently takes to long to look through all the channels (200) + // with every frequency step, because we have to read each channel from eeprom + // before checking the channels frequency // // TODO: include this once we have the entire eeprom loaded // @@ -909,7 +914,9 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio g_request_save_channel = 1; } else - { // don't need to go through all the other stuff .. lets speed things up ! + { // don't need to go through all the other stuff + // lets speed things up by simply setting the VCO/PLL frequency + // and the RF filter path (LNA and PA) #ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS if (!key_held && key_pressed) @@ -922,8 +929,8 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio } #endif - BK4819_set_rf_frequency(frequency, true); - BK4819_set_rf_filter_path(frequency); + BK4819_set_rf_frequency(frequency, true); // set the VCO/PLL + BK4819_set_rf_filter_path(frequency); // set the proper LNA/PA filter path } return; diff --git a/firmware.bin b/firmware.bin index 1d2b4aa..cd977a1 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 9278d37..f941f93 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/settings.h b/settings.h index b7a0f7b..81e1840 100644 --- a/settings.h +++ b/settings.h @@ -261,24 +261,20 @@ typedef struct { t_channel channel[200]; // unused channels are set to all '0xff' // 0x0C80 - #if 0 - t_channel vfo[14]; // 2 VFO's (upper/lower) per band, 7 frequency bands - #else - union { // 2 VFO's (upper/lower) per band, 7 frequency bands - t_channel vfo[14]; // - struct { // - t_channel a; // - t_channel b; // - } __attribute__((packed)) vfo_band[7]; // - } __attribute__((packed)); // - #endif + union { // 2 VFO's (upper/lower) per band, 7 frequency bands + t_channel vfo[14]; // + struct { // + t_channel a; // + t_channel b; // + } __attribute__((packed)) vfo_band[7]; // + } __attribute__((packed)); // // 0x0D60 struct { // these channel attribute settings could have been in the t_channel structure ! - uint8_t band:4; // why do QS have these bits ? .. band can/is computed from the frequency + uint8_t band:4; // why do QS have these bits ? band can/is computed from the frequency uint8_t unused:2; // - uint8_t scanlist2:1; // set if is in scan list 2 - uint8_t scanlist1:1; // set if is in scan list 1 + uint8_t scanlist2:1; // set if in scan list 2 + uint8_t scanlist1:1; // set if in scan list 1 } __attribute__((packed)) channel_attr[200]; // uint8_t unused1[8]; // 0xff's @@ -292,7 +288,7 @@ typedef struct { // 0x0E70 uint8_t call1; // - uint8_t squelch; // + uint8_t squelch_level; // uint8_t tx_timeout; // uint8_t noaa_auto_scan; // uint8_t key_lock; // @@ -306,9 +302,9 @@ typedef struct { #endif uint8_t channel_display_mode; // uint8_t cross_vfo; // - uint8_t battery_save; // + uint8_t battery_save_ratio; // uint8_t dual_watch; // - uint8_t backlight; // + uint8_t backlight_time; // uint8_t tail_tone_elimination; // uint8_t vfo_open; // @@ -387,7 +383,7 @@ typedef struct { uint8_t unused10; // 0xff's // 0x0F20 - uint8_t unused11[8]; // 0xff's + uint8_t unused11[16]; // 0xff's // 0x0F30 uint8_t aes_key[16]; // disabled = all 0xff @@ -429,7 +425,7 @@ typedef struct { char name[10]; uint8_t unused[6]; // 0xff's } __attribute__((packed)) channel_name[200]; - + // 0x1BD0 uint8_t unused13[16 * 3]; // 0xff's .. free to use