diff --git a/firmware/baseband/event_m4.hpp b/firmware/baseband/event_m4.hpp index f0a7e5b4..09b00fa2 100644 --- a/firmware/baseband/event_m4.hpp +++ b/firmware/baseband/event_m4.hpp @@ -50,8 +50,6 @@ public: private: static Thread* thread_event_loop; - BasebandThread baseband_thread { NORMALPRIO + 20 }; - RSSIThread rssi_thread { NORMALPRIO + 10 }; bool is_running = true; diff --git a/firmware/baseband/proc_ais.hpp b/firmware/baseband/proc_ais.hpp index 966d739a..7fa0d40c 100644 --- a/firmware/baseband/proc_ais.hpp +++ b/firmware/baseband/proc_ais.hpp @@ -23,6 +23,7 @@ #define __PROC_AIS_H__ #include "baseband_processor.hpp" +#include "baseband_thread.hpp" #include "channel_decimator.hpp" #include "matched_filter.hpp" @@ -47,6 +48,10 @@ public: void execute(const buffer_c8_t& buffer) override; private: + static constexpr size_t baseband_fs = 2457600; + + BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 }; + std::array dst; const buffer_c16_t dst_buffer { dst.data(), diff --git a/firmware/baseband/proc_am_audio.hpp b/firmware/baseband/proc_am_audio.hpp index 051f1703..08cca3e5 100644 --- a/firmware/baseband/proc_am_audio.hpp +++ b/firmware/baseband/proc_am_audio.hpp @@ -23,6 +23,8 @@ #define __PROC_AM_AUDIO_H__ #include "baseband_processor.hpp" +#include "baseband_thread.hpp" +#include "rssi_thread.hpp" #include "dsp_decimate.hpp" #include "dsp_demodulate.hpp" @@ -44,6 +46,9 @@ private: static constexpr size_t decim_2_decimation_factor = 4; static constexpr size_t channel_filter_decimation_factor = 1; + BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 }; + RSSIThread rssi_thread { NORMALPRIO + 10 }; + std::array dst; const buffer_c16_t dst_buffer { dst.data(), diff --git a/firmware/baseband/proc_capture.hpp b/firmware/baseband/proc_capture.hpp index e975d99c..c2b48b0c 100644 --- a/firmware/baseband/proc_capture.hpp +++ b/firmware/baseband/proc_capture.hpp @@ -23,6 +23,9 @@ #define __PROC_CAPTURE_HPP__ #include "baseband_processor.hpp" +#include "baseband_thread.hpp" +#include "rssi_thread.hpp" + #include "dsp_decimate.hpp" #include "spectrum_collector.hpp" @@ -45,6 +48,9 @@ private: static constexpr size_t baseband_fs = 4000000; static constexpr auto spectrum_rate_hz = 50.0f; + BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 }; + RSSIThread rssi_thread { NORMALPRIO + 10 }; + std::array dst; const buffer_c16_t dst_buffer { dst.data(), diff --git a/firmware/baseband/proc_ert.hpp b/firmware/baseband/proc_ert.hpp index 9c0663c9..dc0a9ecc 100644 --- a/firmware/baseband/proc_ert.hpp +++ b/firmware/baseband/proc_ert.hpp @@ -23,6 +23,7 @@ #define __PROC_ERT_H__ #include "baseband_processor.hpp" +#include "baseband_thread.hpp" #include "channel_decimator.hpp" @@ -61,6 +62,8 @@ private: const size_t samples_per_symbol = channel_sampling_rate / symbol_rate; const float clock_recovery_rate = symbol_rate * 2; + BasebandThread baseband_thread { baseband_sampling_rate, this, NORMALPRIO + 20 }; + clock_recovery::ClockRecovery clock_recovery { clock_recovery_rate, symbol_rate, { 1.0f / 18.0f }, [this](const float symbol) { this->consume_symbol(symbol); } diff --git a/firmware/baseband/proc_nfm_audio.hpp b/firmware/baseband/proc_nfm_audio.hpp index 164e0b45..f4529a73 100644 --- a/firmware/baseband/proc_nfm_audio.hpp +++ b/firmware/baseband/proc_nfm_audio.hpp @@ -23,6 +23,8 @@ #define __PROC_NFM_AUDIO_H__ #include "baseband_processor.hpp" +#include "baseband_thread.hpp" +#include "rssi_thread.hpp" #include "dsp_decimate.hpp" #include "dsp_demodulate.hpp" @@ -41,6 +43,9 @@ public: private: static constexpr size_t baseband_fs = 3072000; + BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 }; + RSSIThread rssi_thread { NORMALPRIO + 10 }; + std::array dst; const buffer_c16_t dst_buffer { dst.data(), diff --git a/firmware/baseband/proc_tpms.hpp b/firmware/baseband/proc_tpms.hpp index ba3294d2..bc1c0b3f 100644 --- a/firmware/baseband/proc_tpms.hpp +++ b/firmware/baseband/proc_tpms.hpp @@ -23,6 +23,8 @@ #define __PROC_TPMS_H__ #include "baseband_processor.hpp" +#include "baseband_thread.hpp" +#include "rssi_thread.hpp" #include "channel_decimator.hpp" #include "matched_filter.hpp" @@ -62,6 +64,11 @@ public: void execute(const buffer_c8_t& buffer) override; private: + static constexpr size_t baseband_fs = 2457600; + + BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 }; + RSSIThread rssi_thread { NORMALPRIO + 10 }; + std::array dst; const buffer_c16_t dst_buffer { dst.data(), diff --git a/firmware/baseband/proc_wfm_audio.hpp b/firmware/baseband/proc_wfm_audio.hpp index 9752f90a..446990f5 100644 --- a/firmware/baseband/proc_wfm_audio.hpp +++ b/firmware/baseband/proc_wfm_audio.hpp @@ -23,6 +23,8 @@ #define __PROC_WFM_AUDIO_H__ #include "baseband_processor.hpp" +#include "baseband_thread.hpp" +#include "rssi_thread.hpp" #include "dsp_decimate.hpp" #include "dsp_demodulate.hpp" @@ -40,6 +42,9 @@ private: static constexpr size_t baseband_fs = 3072000; static constexpr auto spectrum_rate_hz = 50.0f; + BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 }; + RSSIThread rssi_thread { NORMALPRIO + 10 }; + std::array dst; const buffer_c16_t dst_buffer { dst.data(), diff --git a/firmware/baseband/proc_wideband_spectrum.hpp b/firmware/baseband/proc_wideband_spectrum.hpp index 5a875735..7a650ee0 100644 --- a/firmware/baseband/proc_wideband_spectrum.hpp +++ b/firmware/baseband/proc_wideband_spectrum.hpp @@ -23,6 +23,9 @@ #define __PROC_WIDEBAND_SPECTRUM_H__ #include "baseband_processor.hpp" +#include "baseband_thread.hpp" +#include "rssi_thread.hpp" + #include "spectrum_collector.hpp" #include "message.hpp" @@ -38,6 +41,11 @@ public: void on_message(const Message* const message) override; private: + static constexpr size_t baseband_fs = 20000000; + + BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 }; + RSSIThread rssi_thread { NORMALPRIO + 10 }; + SpectrumCollector channel_spectrum; std::array spectrum;