From c825a027b20c48a416f6c3ad5b77c5110082a852 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 11 Dec 2015 17:29:58 -0800 Subject: [PATCH] Comments regarding threading concerns, future refactoring. --- firmware/baseband/spectrum_collector.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/firmware/baseband/spectrum_collector.cpp b/firmware/baseband/spectrum_collector.cpp index 364cb44b1..e344a0f59 100644 --- a/firmware/baseband/spectrum_collector.cpp +++ b/firmware/baseband/spectrum_collector.cpp @@ -29,11 +29,17 @@ #include +/* TODO: Refactor to register task with idle thread? + * It's sad that the idle thread has to call all the way back here just to + * perform the deferred task on the buffer of data we prepared. + */ + void SpectrumCollector::feed( const buffer_c16_t& channel, const uint32_t filter_pass_frequency, const uint32_t filter_stop_frequency ) { + // Called from baseband processing thread. channel_filter_pass_frequency = filter_pass_frequency; channel_filter_stop_frequency = filter_stop_frequency; channel_spectrum_decimator.feed( @@ -45,6 +51,7 @@ void SpectrumCollector::feed( } void SpectrumCollector::post_message(const buffer_c16_t& data) { + // Called from baseband processing thread. if( !channel_spectrum_request_update ) { fft_swap(data, channel_spectrum); channel_spectrum_sampling_rate = data.sampling_rate;