Postpone clearing channel_spectrum_request_update until finished with data in array.

There was potential for new samples to be copied into array as the FFT and post-processing were occuring.
This commit is contained in:
Jared Boone 2016-01-10 10:45:22 -08:00
parent d821afc60d
commit 62e5ec1dbb

View File

@ -81,7 +81,6 @@ void SpectrumCollector::update() {
// Called from idle thread (after EVT_MASK_SPECTRUM is flagged) // Called from idle thread (after EVT_MASK_SPECTRUM is flagged)
if( streaming && channel_spectrum_request_update ) { if( streaming && channel_spectrum_request_update ) {
/* Decimated buffer is full. Compute spectrum. */ /* Decimated buffer is full. Compute spectrum. */
channel_spectrum_request_update = false;
fft_c_preswapped(channel_spectrum); fft_c_preswapped(channel_spectrum);
ChannelSpectrum spectrum; ChannelSpectrum spectrum;
@ -100,4 +99,6 @@ void SpectrumCollector::update() {
} }
fifo.in(spectrum); fifo.in(spectrum);
} }
channel_spectrum_request_update = false;
} }