From 3ff124372c0cbabe4a75a239be9d2844dcefe71c Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sat, 16 Jul 2022 08:39:04 +0200 Subject: [PATCH] Add LNA compression warning --- plot.c | 2 +- sa_core.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/plot.c b/plot.c index dc97f4a..1b3da9c 100644 --- a/plot.c +++ b/plot.c @@ -1767,7 +1767,7 @@ static void cell_draw_marker_info(int x0, int y0) uint16_t color; int level = temppeakLevel - get_attenuation() + setting.external_gain; if ((!setting.normalized[t] && !setting.subtract[t]) && // Disabled when normalized or subtract - ((setting.mode == M_LOW && level > -10) + ((setting.mode == M_LOW && (setting.extra_lna ? level > -32 : level > -10)) || (setting.mode == M_HIGH && level > -29) || (setting.mode == M_LOW && (markers[i].mtype & M_NOISE) && vbwSteps > 1)) //MAXPEAK increases noise marker, should reduce span. ) diff --git a/sa_core.c b/sa_core.c index d98749b..f66c0d0 100644 --- a/sa_core.c +++ b/sa_core.c @@ -7056,7 +7056,7 @@ void calibration_busy(void) { } enum {CS_NORMAL, CS_LNA, CS_SWITCH, CS_ULTRA, CS_ULTRA_LNA, CS_DIRECT_REF, CS_DIRECT, CS_DIRECT_LNA, CS_MAX }; -#define DRIRECT_CAL_FREQ 510000000 // 510MHz +#define DRIRECT_CAL_FREQ 990000000 // 990MHz #else enum {CS_NORMAL, CS_SWITCH, CS_MAX }; #endif @@ -7158,34 +7158,35 @@ void calibrate(void) break; case CS_SWITCH: setting.atten_step = true; + force_signal_path = false; break; #ifdef TINYSA4 case CS_ULTRA: - force_signal_path = true; test_path = 2; // Ultra path + force_signal_path = true; break; case CS_ULTRA_LNA: - force_signal_path = true; test_path = 3; // Ultra lna path + force_signal_path = true; break; case CS_LNA: - force_signal_path = true; test_path = 1; // Normal lna path + force_signal_path = true; break; case CS_DIRECT_REF: set_sweep_frequency(ST_CENTER, DRIRECT_CAL_FREQ); + test_path = 2; // Ultra force_signal_path = true; - test_path = 0; // Normal path at 900MHz break; case CS_DIRECT: set_sweep_frequency(ST_CENTER, DRIRECT_CAL_FREQ); - force_signal_path = true; test_path = 4; // Direct path at 900MHz + force_signal_path = true; break; case CS_DIRECT_LNA: set_sweep_frequency(ST_CENTER, DRIRECT_CAL_FREQ); - force_signal_path = true; test_path = 5; // Direct lna path at 900MHz + force_signal_path = true; break; #endif }