mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-03-01 05:07:21 +00:00
Comments regarding threading concerns, future refactoring.
This commit is contained in:
parent
d1637db2fc
commit
c825a027b2
@ -29,11 +29,17 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
/* 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(
|
void SpectrumCollector::feed(
|
||||||
const buffer_c16_t& channel,
|
const buffer_c16_t& channel,
|
||||||
const uint32_t filter_pass_frequency,
|
const uint32_t filter_pass_frequency,
|
||||||
const uint32_t filter_stop_frequency
|
const uint32_t filter_stop_frequency
|
||||||
) {
|
) {
|
||||||
|
// Called from baseband processing thread.
|
||||||
channel_filter_pass_frequency = filter_pass_frequency;
|
channel_filter_pass_frequency = filter_pass_frequency;
|
||||||
channel_filter_stop_frequency = filter_stop_frequency;
|
channel_filter_stop_frequency = filter_stop_frequency;
|
||||||
channel_spectrum_decimator.feed(
|
channel_spectrum_decimator.feed(
|
||||||
@ -45,6 +51,7 @@ void SpectrumCollector::feed(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SpectrumCollector::post_message(const buffer_c16_t& data) {
|
void SpectrumCollector::post_message(const buffer_c16_t& data) {
|
||||||
|
// Called from baseband processing thread.
|
||||||
if( !channel_spectrum_request_update ) {
|
if( !channel_spectrum_request_update ) {
|
||||||
fft_swap(data, channel_spectrum);
|
fft_swap(data, channel_spectrum);
|
||||||
channel_spectrum_sampling_rate = data.sampling_rate;
|
channel_spectrum_sampling_rate = data.sampling_rate;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user