diff --git a/main.c b/main.c index d6ec213..71c5f0d 100644 --- a/main.c +++ b/main.c @@ -1379,6 +1379,8 @@ set_sweep_frequency(int type, freq_t freq) center = START_MIN + span; if (center > STOP_MAX - span) center = STOP_MAX - span; + if (span != 0 && span < sweep_points) + span = sweep_points; setting.frequency0 = center - span; setting.frequency1 = center + span; break; diff --git a/sa_core.c b/sa_core.c index fde4608..56a1e8f 100644 --- a/sa_core.c +++ b/sa_core.c @@ -3964,7 +3964,7 @@ again: // Spur redu if (setting.mode == M_GENLOW) { if (local_modulo == 0) ADF4351_modulo(1000); ADF4351_R_counter(3); - } else if (lf > 8000000 && lf < 1000000000 && MODE_INPUT(setting.mode)) { + } else if (lf > 8000000 && lf < 3000000000 && MODE_INPUT(setting.mode)) { if (local_modulo == 0) ADF4351_modulo(4000); freq_t tf = ((lf + actual_rbw_x10*200) / TCXO) * TCXO; @@ -5372,8 +5372,13 @@ static volatile int dummy; set_marker_index(1, r); freq_t lf = markers[0].frequency; freq_t rf = markers[1].frequency; - markers[2].enabled = search_maximum(2, lf - (rf - lf), 12); - markers[3].enabled = search_maximum(3, rf + (rf - lf), 12); +#ifdef TINYSA4 +#define OIP3_SPAN 40 +#else +#define OIP3_SPAN 12 +#endif + markers[2].enabled = search_maximum(2, lf - (rf - lf), 40); + markers[3].enabled = search_maximum(3, rf + (rf - lf), 40); } else if (setting.measurement == M_PHASE_NOISE && markers[0].index > 10) { // ------------Phase noise measurement // Position phase noise marker at requested offset set_marker_index(1, markers[0].index + (setting.mode == M_LOW ? WIDTH/4 : -WIDTH/4)); diff --git a/ui_sa.c b/ui_sa.c index 4fd3eab..92b0bb8 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -1444,8 +1444,13 @@ static UI_FUNCTION_ADV_CALLBACK(menu_measure_acb) freq_t right = uistat.value; set_sweep_frequency(ST_CENTER, (left+right)/2); freq_t local_span = (right - left)*10; +#ifdef TINYSA4 + if (local_span < 3000) + local_span = 3000; +#else if (local_span < 30000) local_span = 30000; +#endif set_sweep_frequency(ST_SPAN, local_span); set_average(0,AV_4); // set_measurement(M_OIP3); @@ -1520,9 +1525,11 @@ static UI_FUNCTION_ADV_CALLBACK(menu_measure_acb) kp_help_text = "Modulation frequency: 3 .. 10kHz"; #endif ui_mode_keypad(KM_SPAN); -// if (uistat.value < 3000) -// break; span = uistat.value; +#ifdef TINYSA4 + if (span < 500 || span > 10000) + goto no_measurement; +#endif #ifdef TINYSA4 set_RBW((span * 5 / 50) / 100); #endif