From a0c410fbccc0e9538ff4c2a23560cb32c13f80b1 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sat, 5 Jun 2021 12:23:34 +0200 Subject: [PATCH] Restore settings after calibration --- plot.c | 7 ++++--- sa_core.c | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plot.c b/plot.c index 4b337ab..ab04da6 100644 --- a/plot.c +++ b/plot.c @@ -1713,9 +1713,10 @@ static void cell_draw_marker_info(int x0, int y0) uint16_t color; int level = temppeakLevel - get_attenuation() + setting.external_gain; if ((!setting.subtract_stored) && // Disabled when normalized - ((setting.mode == M_LOW && 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. + ((setting.mode == M_LOW && 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. + ) color = LCD_BRIGHT_COLOR_RED; else color = marker_color(markers[i].mtype); diff --git a/sa_core.c b/sa_core.c index 56b3d52..2dd5354 100644 --- a/sa_core.c +++ b/sa_core.c @@ -5911,6 +5911,7 @@ again: #if 1 reset_settings(M_LOW); set_refer_output(0); + set_attenuation(10); set_sweep_frequency(ST_STOP, 60000000); int test_case = TEST_POWER; #ifdef TINYSA4 @@ -6023,11 +6024,14 @@ quit: in_selftest = false; sweep_mode = SWEEP_ENABLE; // set_refer_output(-1); -// reset_settings(M_LOW); #ifdef TINYSA4 set_extra_lna(false); -#endif set_average(AV_OFF); +// set_refer_output(-1); +#else + reset_settings(M_LOW); + set_refer_output(-1); +#endif }