diff --git a/main.c b/main.c index d144b37..e367dae 100644 --- a/main.c +++ b/main.c @@ -1262,7 +1262,7 @@ const float v5_2_correction_value[CORRECTION_SIZE][CORRECTION_POINTS]= /* out */ { 8.37, 5.53, 2.3, -1.37, -3.14, -3.43, -5.06, -5.59, -5.95, -5.59, -4.55, -5.06, -5.06, -5.59, -5.35, -5.78, -5.12, -5.17, -3.81, -2.37}, /* direct */ { -3.9, -2.73, -2.55, -2.5, -1.04, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03, -0.03}, /* adf */ { -3.25, -2.51, -1.77, -1.34, -0.16, 2.8, 5.37, 5.23, 3.76, -0.93, -1.98, -4.71, -5.41, -7.41, -8.63, -8.53, -8.28, -7.66, -7.56, -5.78}, - /* ultra */ { 8.24, 4.14, 1.31, -1.56, -3.29, -5.09, -5.59, -4.86, -5.78, -4.61, -4.67, -2.02, -2.93, -0.36, 2.78, 1.84, 4.97, 8.07, 11.98, 11.47}, + /* ultra */ { 8.24, 4.14, 1.31, -1.56, -3.29, -5.09, -5.59, -4.86, -5.78, -4.61, -4.67, -2.02, -2.93, -0.36, 2.78, 1.84, 4.97, 8.07, 10.8, 22.47}, }; const float v5_2_harmonic_lna_level_offset = 0; // should be in correction table now -7; // Depends on where the transition to harmonic is done!!!!!! TODO find best frequency to transition to harmonic @@ -2447,7 +2447,7 @@ static const VNAShellCommand commands[] = #ifdef ENABLE_COLOR_COMMAND {"color" , cmd_color , CMD_RUN_IN_LOAD}, #endif - { "if", cmd_if, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD }, + { "if", cmd_if, CMD_RUN_IN_LOAD }, #ifdef TINYSA4 { "if1", cmd_if1, CMD_RUN_IN_LOAD }, { "lna2", cmd_lna2, CMD_RUN_IN_LOAD }, diff --git a/nanovna.h b/nanovna.h index f050ba8..f2e02de 100644 --- a/nanovna.h +++ b/nanovna.h @@ -177,7 +177,8 @@ extern char *hw_text; #define DRIVE2_MAX_FREQ 2100000000ULL // LO drive 2 #define LOW_SHIFT_FREQ 2000000ULL // shift IF to avoid zero Hz within IF -#define USE_SHIFT2_RBW 4000 // use shift2_level_offset if actual_rbw_x10 is larger then this. +#define USE_SHIFT2_RBW 8500 // shift2_level_offset rbw +#define USE_SHIFT1_RBW 6000 // shift1_level_offset rbw #ifdef __NEW_SWITCHES__ #define DIRECT_START config.direct_start #define DIRECT_STOP config.direct_stop diff --git a/sa_core.c b/sa_core.c index c24b849..9da8b60 100644 --- a/sa_core.c +++ b/sa_core.c @@ -4901,7 +4901,7 @@ again: // Spur redu pureRSSI = Si446x_RSSI(break_on_operation); if (LO_shifting && (signal_path != PATH_DIRECT)) { if (f < 5000000) - pureRSSI += float_TO_PURE_RSSI(actual_rbw_x10>USE_SHIFT2_RBW ? config.shift2_level_offset : (lf < LOW_SHIFT_FREQ ? config.shift1_level_offset: 0.0)); + pureRSSI -= float_TO_PURE_RSSI(actual_rbw_x10 == USE_SHIFT2_RBW ? config.shift2_level_offset : (actual_rbw_x10 == USE_SHIFT1_RBW ? config.shift1_level_offset : 0)); else pureRSSI += float_TO_PURE_RSSI(config.shift_level_offset); } @@ -6689,8 +6689,8 @@ float measure_jump(int i) { right += actual_t[j]; } right /= h_p; - if (i <= 1) // for 2MHz jump - return(right-left); // returns level jump low to high frequency. +// if (i <= 1) // for 2MHz jump +// return(right-left); // returns level jump low to high frequency. return (left - right); } #endif @@ -7916,8 +7916,10 @@ void calibrate(void) // setting.spur_removal = S_OFF; // set_reflevel(-95); } else if (i <= 1) { - if (i == 1) - set_RBW(8500); + if (i == 0) + set_RBW(USE_SHIFT1_RBW); + else + set_RBW(USE_SHIFT2_RBW); set_refer_output(5); // 2MHz setting.spur_removal = S_OFF; } else {