diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp index 4c75eb2e..1d1ba109 100755 --- a/firmware/baseband/main.cpp +++ b/firmware/baseband/main.cpp @@ -382,11 +382,6 @@ public: virtual void execute(buffer_c8_t buffer) = 0; protected: - BlockDecimator<256> channel_spectrum_decimator { 4 }; - - ChannelStatsCollector channel_stats; - ChannelStatisticsMessage channel_stats_message; - void feed_channel_stats(const buffer_c16_t channel) { channel_stats.feed( channel, @@ -396,13 +391,6 @@ protected: ); } - void post_channel_stats_message(const ChannelStatistics statistics) { - if( channel_stats_message.is_free() ) { - channel_stats_message.statistics = statistics; - shared_memory.application_queue.push(&channel_stats_message); - } - } - void feed_channel_spectrum(const buffer_c16_t channel) { channel_spectrum_decimator.feed( channel, @@ -412,6 +400,39 @@ protected: ); } + void fill_audio_buffer(const buffer_s16_t audio) { + auto audio_buffer = audio::dma::tx_empty_buffer();; + for(size_t i=0; i channel_spectrum_decimator { 4 }; + + ChannelStatsCollector channel_stats; + ChannelStatisticsMessage channel_stats_message; + + AudioStatsCollector audio_stats; + AudioStatisticsMessage audio_stats_message; + + void post_channel_stats_message(const ChannelStatistics statistics) { + if( channel_stats_message.is_free() ) { + channel_stats_message.statistics = statistics; + shared_memory.application_queue.push(&channel_stats_message); + } + } + void post_channel_spectrum_message(const buffer_c16_t data) { if( !channel_spectrum_request_update ) { channel_spectrum_request_update = true; @@ -421,9 +442,6 @@ protected: } } - AudioStatsCollector audio_stats; - AudioStatisticsMessage audio_stats_message; - void feed_audio_stats(const buffer_s16_t audio) { audio_stats.feed( audio, @@ -439,21 +457,6 @@ protected: shared_memory.application_queue.push(&audio_stats_message); } } - - void fill_audio_buffer(const buffer_s16_t audio) { - auto audio_buffer = audio::dma::tx_empty_buffer();; - for(size_t i=0; i 48kHz int16_t[32] */ audio_hpf.execute_in_place(audio); - feed_audio_stats(audio); fill_audio_buffer(audio); }