Scan optimization and disable waterfall

Removed_REF_marker
erikkaashoek 5 years ago
parent e0a6e9cb43
commit acc5cf582e

@ -1309,8 +1309,10 @@ extern uint16_t force_rbw(int f);
extern void SI4463_do_api(void* data, uint8_t len, void* out, uint8_t outLen); extern void SI4463_do_api(void* data, uint8_t len, void* out, uint8_t outLen);
extern void SI4463_set_gpio(int i, int s); extern void SI4463_set_gpio(int i, int s);
extern void si_set_offset(int16_t offset); extern void si_set_offset(int16_t offset);
extern int SI4463_offset_changed;
extern void si_fm_offset(int16_t offset); extern void si_fm_offset(int16_t offset);
extern bool ADF4351_frequency_changed;
extern bool SI4463_frequency_changed;
extern bool SI4463_offset_changed;
extern int old_R;
#endif #endif
/*EOF*/ /*EOF*/

@ -1669,12 +1669,8 @@ toggle_waterfall(void)
void void
disable_waterfall(void) disable_waterfall(void)
{ {
graph_bottom = NO_WATERFALL; setting.waterfall = W_BIG;
setting.waterfall = W_OFF; toggle_waterfall();
_grid_y = graph_bottom / NGRIDY;
ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(OFFSETX, graph_bottom, LCD_WIDTH - OFFSETX, CHART_BOTTOM - graph_bottom);
request_to_redraw_grid();
} }
void void

@ -870,8 +870,8 @@ VNA_SHELL_FUNCTION(cmd_scanraw)
points = my_atoi(argv[2]); points = my_atoi(argv[2]);
} }
// if (get_waterfall()) if (get_waterfall())
// disable_waterfall(); // display dma hangs when waterfall is enabled disable_waterfall(); // display dma hangs when waterfall is enabled
freq_t old_step = setting.frequency_step; freq_t old_step = setting.frequency_step;
float f_step = (stop-start)/ points; float f_step = (stop-start)/ points;

@ -171,6 +171,7 @@ void reset_settings(int m)
drive_dBm = (float *) (setting.mode == M_GENHIGH && config.high_out_adf4350 ? adf_drive_dBm : si_drive_dBm); drive_dBm = (float *) (setting.mode == M_GENHIGH && config.high_out_adf4350 ? adf_drive_dBm : si_drive_dBm);
#endif #endif
update_min_max_freq(); update_min_max_freq();
disable_waterfall();
sweep_mode |= SWEEP_ENABLE; sweep_mode |= SWEEP_ENABLE;
setting.unit_scale_index = 0; setting.unit_scale_index = 0;
setting.unit_scale = 1; setting.unit_scale = 1;
@ -2553,12 +2554,18 @@ modulation_again:
if (!setting.auto_IF) if (!setting.auto_IF)
local_IF = setting.frequency_IF; local_IF = setting.frequency_IF;
else else
#ifdef TINYSA4 {
local_IF = config.frequency_IF1; #ifdef TINYSA4
if (f < 2000000 && S_IS_AUTO(setting.spur_removal) && S_IS_AUTO(setting.below_IF))
local_IF = config.frequency_IF1 + DEFAULT_SPUR_OFFSET;
else
local_IF = config.frequency_IF1;
#else #else
local_IF = DEFAULT_IF; local_IF = DEFAULT_IF;
#endif #endif
if (setting.mode == M_LOW) { }
if (setting.mode == M_LOW) {
if (tracking) { // VERY SPECIAL CASE!!!!! Measure BPF if (tracking) { // VERY SPECIAL CASE!!!!! Measure BPF
#if 0 // Isolation test #if 0 // Isolation test
local_IF = lf; local_IF = lf;
@ -2961,6 +2968,21 @@ modulation_again:
} }
start_of_sweep_timestamp = chVTGetSystemTimeX(); start_of_sweep_timestamp = chVTGetSystemTimeX();
} }
#ifdef TINYSA4
if (SI4432_step_delay && (ADF4351_frequency_changed || SI4463_frequency_changed)) {
int my_step_delay = SI4432_step_delay;
if (f < 2000000 && actual_rbw_x10 == 3)
my_step_delay = my_step_delay * 2;
my_microsecond_delay(my_step_delay * ((setting.R == 0 && old_R > 5 ) ? 8 : 1));
ADF4351_frequency_changed = false;
SI4463_frequency_changed = false;
SI4463_offset_changed = false;
} else if (SI4432_offset_delay && SI4463_offset_changed) {
my_microsecond_delay(SI4432_offset_delay);
SI4463_offset_changed = false;
}
#endif
//else //else
{ {
#ifdef __SI4432__ #ifdef __SI4432__

@ -936,7 +936,7 @@ int debug = 0;
ioline_t ADF4351_LE[2] = { LINE_LO_SEL, LINE_LO_SEL}; ioline_t ADF4351_LE[2] = { LINE_LO_SEL, LINE_LO_SEL};
//int ADF4351_Mux = 7; //int ADF4351_Mux = 7;
int ADF4351_frequency_changed = false; bool ADF4351_frequency_changed = false;
//#define DEBUG(X) // Serial.print( X ) //#define DEBUG(X) // Serial.print( X )
//#define DEBUGLN(X) Serial.println( X ) //#define DEBUGLN(X) Serial.println( X )
@ -964,7 +964,7 @@ volatile int64_t
uint8_t OutputDivider; // Temp uint8_t OutputDivider; // Temp
uint8_t lock=2; //Not used uint8_t lock=2; //Not used
static int old_R = 0; int old_R = 0;
// Lock = A4 // Lock = A4
@ -1300,8 +1300,8 @@ void ADF4351_enable_out(int s)
// ------------------------------ SI4463 ------------------------------------- // ------------------------------ SI4463 -------------------------------------
int SI4463_frequency_changed = false; bool SI4463_frequency_changed = false;
int SI4463_offset_changed = false; bool SI4463_offset_changed = false;
int SI4463_offset_value = 0; int SI4463_offset_value = 0;
static int SI4463_band = -1; static int SI4463_band = -1;
@ -1934,15 +1934,7 @@ int16_t Si446x_RSSI(void)
SI446X_CMD_GET_MODEM_STATUS, SI446X_CMD_GET_MODEM_STATUS,
0xFF 0xFF
}; };
if (SI4432_step_delay && (ADF4351_frequency_changed || SI4463_frequency_changed)) {
my_microsecond_delay(SI4432_step_delay * ((setting.R == 0 && old_R > 5 ) ? 8 : 1));
ADF4351_frequency_changed = false;
SI4463_frequency_changed = false;
SI4463_offset_changed = false;
} else if (SI4432_offset_delay && SI4463_offset_changed) {
my_microsecond_delay(SI4432_offset_delay);
SI4463_offset_changed = false;
}
#define SAMPLE_COUNT 1 #define SAMPLE_COUNT 1
int j = SAMPLE_COUNT; //setting.repeat; int j = SAMPLE_COUNT; //setting.repeat;
int RSSI_RAW_ARRAY[3]; int RSSI_RAW_ARRAY[3];

Loading…
Cancel
Save

Powered by TurnKey Linux.