From a2ebce907930f189e1bbf16be6694b6606995600 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sat, 10 Jul 2021 12:38:04 +0200 Subject: [PATCH] Corrected subtract and average count bug --- nanovna.h | 1 + plot.c | 2 +- sa_core.c | 47 ++++++++++++++++++++++++++++++----------------- ui_sa.c | 5 +++-- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/nanovna.h b/nanovna.h index ebb7d65..2730e9a 100644 --- a/nanovna.h +++ b/nanovna.h @@ -1046,6 +1046,7 @@ typedef struct setting uint32_t rbw_x10; uint32_t vbw_x100; + uint32_t scan_after_dirty[TRACES_MAX]; float reflevel; float scale; diff --git a/plot.c b/plot.c index 0ea9c1d..3ebbd67 100644 --- a/plot.c +++ b/plot.c @@ -1698,7 +1698,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]) && // Disabled when normalized + if ((!setting.normalized[t] && !setting.subtract[t]) && // Disabled when normalized or subtract ((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. diff --git a/sa_core.c b/sa_core.c index 6fdb280..e96ce52 100644 --- a/sa_core.c +++ b/sa_core.c @@ -245,7 +245,8 @@ void reset_settings(int m) } for (int l=0;l