diff --git a/main.c b/main.c index a307fc3..c5975a4 100644 --- a/main.c +++ b/main.c @@ -978,6 +978,8 @@ config_t config = { .lna_level_offset = 100, .low_level_output_offset = 100.0, // Uncalibrated .high_level_output_offset = 0, // Uncalibrated, but checking code is not yet present + .harmonic_level_offset = -11.5, + .shift_level_offset = -1.5, .correction_frequency = { { 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low in diff --git a/plot.c b/plot.c index e482533..4072d53 100644 --- a/plot.c +++ b/plot.c @@ -1528,6 +1528,10 @@ static void trace_print_value_string( // Only used at one place step = step*10; } } +#ifdef TINYSA4 + if (freq >= 1000000000) + digits += 3; +#endif plot_printf(ptr2, sizeof(buf2) - 9, "%9.*QHz", digits, freq); } const char *format; diff --git a/sa_core.c b/sa_core.c index d9041de..bcb4bee 100644 --- a/sa_core.c +++ b/sa_core.c @@ -83,6 +83,9 @@ int linear_averaging = true; static freq_t old_freq[5] = { 0, 0, 0, 0,0}; static freq_t real_old_freq[5] = { 0, 0, 0, 0,0}; static long real_offset = 0; +#ifdef __ULTRA__ +static int LO_harmonic; +#endif void clear_frequency_cache(void) { @@ -1762,7 +1765,7 @@ pureRSSI_t get_frequency_correction(freq_t f) // Frequency dependent RSSI c if (setting.mode == M_LOW && ultra && f > ultra_threshold) { c = CORRECTION_LOW_ULTRA; if ( f > ULTRA_MAX_FREQ) { - cv += float_TO_PURE_RSSI(8.5); // +9dB correction. + cv -= float_TO_PURE_RSSI(config.harmonic_level_offset); // +10.5dB correction. } if (setting.extra_lna) c += 1; @@ -1988,7 +1991,9 @@ void set_freq(int V, freq_t freq) // translate the requested frequency into a // ----------------------------- set mixer drive -------------------------------------------- int target_drive = setting.lo_drive; if (target_drive & 0x04){ // Automatic mixer drive - if (freq-970000000 < 600000000ULL) // below 100MHz + if (LO_harmonic) + target_drive = 3; + else if (freq-970000000 < 600000000ULL) // below 100MHz target_drive = 0; else if (freq-970000000 < 1200000000ULL) // below 1.2GHz target_drive = 1; @@ -2851,9 +2856,6 @@ static int LO_shifted; static int LO_mirrored; static int LO_shifting; #endif -#ifdef __ULTRA__ -static int LO_harmonic; -#endif static void calculate_static_correction(void) // Calculate the static part of the RSSI correction { @@ -4146,8 +4148,8 @@ again: // Spur redu #ifdef TINYSA4 if (LO_shifting) pureRSSI -= float_TO_PURE_RSSI(config.shift_level_offset); - if (LO_harmonic) - pureRSSI -= float_TO_PURE_RSSI(config.harmonic_level_offset); +// if (LO_harmonic) +// pureRSSI -= float_TO_PURE_RSSI(config.harmonic_level_offset); #endif if (RSSI < pureRSSI) // Take max during subscanning