From 47fec0b0241fc27e16abc5efb856d726863b35f4 Mon Sep 17 00:00:00 2001 From: TT Date: Mon, 21 Oct 2019 21:27:56 +0900 Subject: [PATCH] remove buffer used only in dump command --- dsp.c | 4 ++++ nanovna.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/dsp.c b/dsp.c index 80fa97a7..6e9f607c 100644 --- a/dsp.c +++ b/dsp.c @@ -21,8 +21,10 @@ #include #include "nanovna.h" +#ifdef ENABLED_DUMP int16_t samp_buf[SAMPLE_LEN]; int16_t ref_buf[SAMPLE_LEN]; +#endif const int16_t sincos_tbl[48][2] = { { 10533, 31029 }, { 27246, 18205 }, { 32698, -2143 }, { 24636, -21605 }, @@ -59,8 +61,10 @@ dsp_process(int16_t *capture, size_t length) uint32_t sr = *p++; int16_t ref = sr & 0xffff; int16_t smp = (sr>>16) & 0xffff; +#ifdef ENABLED_DUMP ref_buf[i] = ref; samp_buf[i] = smp; +#endif int32_t s = sincos_tbl[i][0]; int32_t c = sincos_tbl[i][1]; samp_s += smp * s / 16; diff --git a/nanovna.h b/nanovna.h index bbbf8195..4a98dc91 100644 --- a/nanovna.h +++ b/nanovna.h @@ -100,8 +100,10 @@ extern int16_t rx_buffer[]; #define STATE_LEN 32 #define SAMPLE_LEN 48 +#ifdef ENABLED_DUMP extern int16_t ref_buf[]; extern int16_t samp_buf[]; +#endif void dsp_process(int16_t *src, size_t len); void reset_dsp_accumerator(void);