Skip to content

Commit

Permalink
remove buffer used only in dump command
Browse files Browse the repository at this point in the history
  • Loading branch information
edy555 committed Oct 22, 2019
1 parent 772e210 commit 47fec0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
#include <arm_math.h>
#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 },
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions nanovna.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 47fec0b

Please sign in to comment.