From a577bc9664c920984eee0cad4c263bde6d1c01b3 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 11 Jan 2016 17:18:24 -0800 Subject: [PATCH] Refactor naughty static variable hiding in WidebandSpectrum. --- firmware/baseband/proc_wideband_spectrum.cpp | 2 -- firmware/baseband/proc_wideband_spectrum.hpp | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/firmware/baseband/proc_wideband_spectrum.cpp b/firmware/baseband/proc_wideband_spectrum.cpp index e91121154..a5b6cd8a2 100644 --- a/firmware/baseband/proc_wideband_spectrum.cpp +++ b/firmware/baseband/proc_wideband_spectrum.cpp @@ -34,8 +34,6 @@ void WidebandSpectrum::execute(const buffer_c8_t& buffer) { // 2048 complex8_t samples per buffer. // 102.4us per buffer. 20480 instruction cycles per buffer. - static int phase = 0; - if( phase == 0 ) { std::fill(spectrum.begin(), spectrum.end(), 0); } diff --git a/firmware/baseband/proc_wideband_spectrum.hpp b/firmware/baseband/proc_wideband_spectrum.hpp index 72179633c..3aff0d3e5 100644 --- a/firmware/baseband/proc_wideband_spectrum.hpp +++ b/firmware/baseband/proc_wideband_spectrum.hpp @@ -43,6 +43,7 @@ private: std::array spectrum; void streaming_config(const SpectrumStreamingConfigMessage& message); + size_t phase = 0; }; #endif/*__PROC_WIDEBAND_SPECTRUM_H__*/