0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-05-01 15:51:25 +03:00

disable monitor mode on scan start

This commit is contained in:
OneOfEleven 2023-10-19 22:04:39 +01:00
parent a6dfca4c91
commit 78b4c93f67
6 changed files with 36 additions and 29 deletions

View File

@ -219,6 +219,10 @@ void ACTION_Scan(bool bRestart)
// start scanning // start scanning
// disable monitor mode
g_monitor_enabled = false;
RADIO_setup_registers(true);
APP_channel_next(true, SCAN_STATE_DIR_FORWARD); APP_channel_next(true, SCAN_STATE_DIR_FORWARD);
g_scan_pause_10ms = 0; // go NOW g_scan_pause_10ms = 0; // go NOW

View File

@ -668,9 +668,9 @@ void APP_stop_scan(void)
static void APP_next_freq(void) static void APP_next_freq(void)
{ {
frequency_band_t new_band; frequency_band_t new_band;
const frequency_band_t old_band = FREQUENCY_GetBand(g_rx_vfo->freq_config_rx.frequency); 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); const uint32_t frequency = APP_set_frequency_by_step(g_rx_vfo, g_scan_state_dir);
new_band = FREQUENCY_GetBand(frequency); new_band = FREQUENCY_GetBand(frequency);

View File

@ -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)) if (IS_FREQ_CHANNEL(Channel))
{ // step/down in frequency { // step/down in frequency
frequency_band_t new_band; frequency_band_t new_band;
const frequency_band_t old_band = FREQUENCY_GetBand(g_tx_vfo->freq_config_rx.frequency); 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); const uint32_t frequency = APP_set_frequency_by_step(g_tx_vfo, Direction);
if (FREQUENCY_rx_freq_check(frequency) < 0) if (FREQUENCY_rx_freq_check(frequency) < 0)
{ // frequency not allowed { // frequency not allowed
@ -893,12 +893,17 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio
return; return;
} }
// compute the frequency band for the frequency
new_band = FREQUENCY_GetBand(frequency); new_band = FREQUENCY_GetBand(frequency);
// save the new frequency into the VFO
g_tx_vfo->freq_config_rx.frequency = frequency; g_tx_vfo->freq_config_rx.frequency = frequency;
// find the first channel that contains this 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 // 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; g_request_save_channel = 1;
} }
else 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 #ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
if (!key_held && key_pressed) 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 #endif
BK4819_set_rf_frequency(frequency, true); BK4819_set_rf_frequency(frequency, true); // set the VCO/PLL
BK4819_set_rf_filter_path(frequency); BK4819_set_rf_filter_path(frequency); // set the proper LNA/PA filter path
} }
return; return;

Binary file not shown.

Binary file not shown.

View File

@ -261,24 +261,20 @@ typedef struct {
t_channel channel[200]; // unused channels are set to all '0xff' t_channel channel[200]; // unused channels are set to all '0xff'
// 0x0C80 // 0x0C80
#if 0 union { // 2 VFO's (upper/lower) per band, 7 frequency bands
t_channel vfo[14]; // 2 VFO's (upper/lower) per band, 7 frequency bands t_channel vfo[14]; //
#else struct { //
union { // 2 VFO's (upper/lower) per band, 7 frequency bands t_channel a; //
t_channel vfo[14]; // t_channel b; //
struct { // } __attribute__((packed)) vfo_band[7]; //
t_channel a; // } __attribute__((packed)); //
t_channel b; //
} __attribute__((packed)) vfo_band[7]; //
} __attribute__((packed)); //
#endif
// 0x0D60 // 0x0D60
struct { // these channel attribute settings could have been in the t_channel structure ! 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 unused:2; //
uint8_t scanlist2:1; // set if is in scan list 2 uint8_t scanlist2:1; // set if in scan list 2
uint8_t scanlist1:1; // set if is in scan list 1 uint8_t scanlist1:1; // set if in scan list 1
} __attribute__((packed)) channel_attr[200]; // } __attribute__((packed)) channel_attr[200]; //
uint8_t unused1[8]; // 0xff's uint8_t unused1[8]; // 0xff's
@ -292,7 +288,7 @@ typedef struct {
// 0x0E70 // 0x0E70
uint8_t call1; // uint8_t call1; //
uint8_t squelch; // uint8_t squelch_level; //
uint8_t tx_timeout; // uint8_t tx_timeout; //
uint8_t noaa_auto_scan; // uint8_t noaa_auto_scan; //
uint8_t key_lock; // uint8_t key_lock; //
@ -306,9 +302,9 @@ typedef struct {
#endif #endif
uint8_t channel_display_mode; // uint8_t channel_display_mode; //
uint8_t cross_vfo; // uint8_t cross_vfo; //
uint8_t battery_save; // uint8_t battery_save_ratio; //
uint8_t dual_watch; // uint8_t dual_watch; //
uint8_t backlight; // uint8_t backlight_time; //
uint8_t tail_tone_elimination; // uint8_t tail_tone_elimination; //
uint8_t vfo_open; // uint8_t vfo_open; //
@ -387,7 +383,7 @@ typedef struct {
uint8_t unused10; // 0xff's uint8_t unused10; // 0xff's
// 0x0F20 // 0x0F20
uint8_t unused11[8]; // 0xff's uint8_t unused11[16]; // 0xff's
// 0x0F30 // 0x0F30
uint8_t aes_key[16]; // disabled = all 0xff uint8_t aes_key[16]; // disabled = all 0xff
@ -429,7 +425,7 @@ typedef struct {
char name[10]; char name[10];
uint8_t unused[6]; // 0xff's uint8_t unused[6]; // 0xff's
} __attribute__((packed)) channel_name[200]; } __attribute__((packed)) channel_name[200];
// 0x1BD0 // 0x1BD0
uint8_t unused13[16 * 3]; // 0xff's .. free to use uint8_t unused13[16 * 3]; // 0xff's .. free to use