diff --git a/nanovna.h b/nanovna.h index e656098..654a8db 100644 --- a/nanovna.h +++ b/nanovna.h @@ -401,6 +401,7 @@ void set_measurement(int); // extern int settingSpeed; //extern int setting.step_delay; void sweep_remote(void); +void calculate_step_delay(void); extern int generic_option_cmd( const char *cmd, const char *cmd_list, int argc, char *argv); #ifdef TINYSA4 @@ -1184,7 +1185,7 @@ typedef struct properties { //sizeof(properties_t) == 0x1200 -#define CONFIG_MAGIC 0x434f4e4e /* 'CONF' */ +#define CONFIG_MAGIC 0x434f4e4f /* 'CONF' */ extern int16_t lastsaveid; //extern properties_t *active_props; diff --git a/sa_core.c b/sa_core.c index 4167ebc..d76a906 100644 --- a/sa_core.c +++ b/sa_core.c @@ -1447,7 +1447,7 @@ static const struct { }; #endif -static void calculate_step_delay(void) +void calculate_step_delay(void) { if (setting.step_delay_mode == SD_MANUAL || setting.step_delay != 0) { // The latter part required for selftest 3 SI4432_step_delay = setting.step_delay; @@ -3111,7 +3111,11 @@ again: // Spur redu #endif else { +#ifdef TINYSA4 + local_IF = local_IF - DEFAULT_SPUR_OFFSET/4; // No spure removal and no spur, center in IF but avoid mirror +#else local_IF = local_IF; // + DEFAULT_SPUR_OFFSET/2; // No spure removal and no spur, center in IF +#endif } } } @@ -3174,7 +3178,7 @@ again: // Spur redu if (tf + actual_rbw_x10*100 >= lf && tf < lf + actual_rbw_x10*100) { // 30MHz ADF4351_R_counter(6); } else { - if (setting.frequency_step < 100000) { + if (actual_rbw_x10 < 1000) { freq_t tf = ((lf + actual_rbw_x10*1000) / TXCO_DIV3) * TXCO_DIV3; if (tf + actual_rbw_x10*100 >= lf && tf < lf + actual_rbw_x10*100) // 10MHz ADF4351_R_counter(4); diff --git a/ui_sa.c b/ui_sa.c index 5b485e7..0a15f56 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -3302,7 +3302,7 @@ redraw_cal_status: else color = LCD_FG_COLOR; ili9341_set_foreground(color); - + if (dirty) update_rbw(); ili9341_drawstring("RBW:", x, y); y += YSTEP; plot_printf(buf, BLEN, "%.1FHz", actual_rbw_x10*100.0); @@ -3341,7 +3341,10 @@ redraw_cal_status: strcpy(&buf[0],"Scan:"); ili9341_drawstring(buf, x, y); - if (dirty) setting.actual_sweep_time_us = calc_min_sweep_time_us(); + if (dirty) { + calculate_step_delay(); + setting.actual_sweep_time_us = calc_min_sweep_time_us(); + } #if 0 // Activate for sweep time debugging y += YSTEP;