diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp index 5f817990..2fa72999 100755 --- a/firmware/baseband/main.cpp +++ b/firmware/baseband/main.cpp @@ -28,19 +28,8 @@ #include "gpdma.hpp" -#include "event_m4.hpp" - #include "touch_dma.hpp" -#include "proc_am_audio.hpp" -#include "proc_nfm_audio.hpp" -#include "proc_wfm_audio.hpp" -#include "proc_ais.hpp" -#include "proc_wideband_spectrum.hpp" -#include "proc_tpms.hpp" -#include "proc_ert.hpp" -#include "proc_capture.hpp" - #include "message_queue.hpp" #include "utility.hpp" @@ -90,10 +79,7 @@ static void init() { touch::dma::enable(); } -static void run() { - EventDispatcher event_dispatcher { std::make_unique() }; - event_dispatcher.run(); -} +extern void run(); static void halt() { port_disable(); diff --git a/firmware/baseband/proc_ais.cpp b/firmware/baseband/proc_ais.cpp index 80452dd0..b5f95319 100644 --- a/firmware/baseband/proc_ais.cpp +++ b/firmware/baseband/proc_ais.cpp @@ -25,6 +25,8 @@ #include "dsp_fir_taps.hpp" +#include "event_m4.hpp" + AISProcessor::AISProcessor() { decim_0.configure(taps_11k0_decim_0.taps, 33554432); decim_1.configure(taps_11k0_decim_1.taps, 131072); @@ -62,3 +64,8 @@ void AISProcessor::payload_handler( const AISPacketMessage message { packet }; shared_memory.application_queue.push(message); } + +void run() { + EventDispatcher event_dispatcher { std::make_unique() }; + event_dispatcher.run(); +} diff --git a/firmware/baseband/proc_am_audio.cpp b/firmware/baseband/proc_am_audio.cpp index f4cb2fac..a35f0742 100644 --- a/firmware/baseband/proc_am_audio.cpp +++ b/firmware/baseband/proc_am_audio.cpp @@ -23,6 +23,8 @@ #include "audio_output.hpp" +#include "event_m4.hpp" + #include void NarrowbandAMAudio::execute(const buffer_c8_t& buffer) { @@ -105,3 +107,8 @@ void NarrowbandAMAudio::capture_config(const CaptureConfigMessage& message) { audio_output.set_stream(nullptr); } } + +void run() { + EventDispatcher event_dispatcher { std::make_unique() }; + event_dispatcher.run(); +} diff --git a/firmware/baseband/proc_capture.cpp b/firmware/baseband/proc_capture.cpp index 56f6a948..d68cae29 100644 --- a/firmware/baseband/proc_capture.cpp +++ b/firmware/baseband/proc_capture.cpp @@ -23,6 +23,8 @@ #include "dsp_fir_taps.hpp" +#include "event_m4.hpp" + #include "utility.hpp" CaptureProcessor::CaptureProcessor() { @@ -90,3 +92,8 @@ void CaptureProcessor::capture_config(const CaptureConfigMessage& message) { stream.reset(); } } + +void run() { + EventDispatcher event_dispatcher { std::make_unique() }; + event_dispatcher.run(); +} diff --git a/firmware/baseband/proc_ert.cpp b/firmware/baseband/proc_ert.cpp index e6ae439c..124c141c 100644 --- a/firmware/baseband/proc_ert.cpp +++ b/firmware/baseband/proc_ert.cpp @@ -23,6 +23,8 @@ #include "portapack_shared_memory.hpp" +#include "event_m4.hpp" + float ERTProcessor::abs(const complex8_t& v) { // const int16_t r = v.real() - offset_i; // const int16_t i = v.imag() - offset_q; @@ -101,3 +103,8 @@ void ERTProcessor::idm_handler( const ERTPacketMessage message { ert::Packet::Type::IDM, packet }; shared_memory.application_queue.push(message); } + +void run() { + EventDispatcher event_dispatcher { std::make_unique() }; + event_dispatcher.run(); +} diff --git a/firmware/baseband/proc_nfm_audio.cpp b/firmware/baseband/proc_nfm_audio.cpp index 122115fa..18280b7c 100644 --- a/firmware/baseband/proc_nfm_audio.cpp +++ b/firmware/baseband/proc_nfm_audio.cpp @@ -23,6 +23,8 @@ #include "audio_output.hpp" +#include "event_m4.hpp" + #include #include @@ -93,3 +95,8 @@ void NarrowbandFMAudio::capture_config(const CaptureConfigMessage& message) { audio_output.set_stream(nullptr); } } + +void run() { + EventDispatcher event_dispatcher { std::make_unique() }; + event_dispatcher.run(); +} diff --git a/firmware/baseband/proc_tpms.cpp b/firmware/baseband/proc_tpms.cpp index 7c6c83d6..61a23739 100644 --- a/firmware/baseband/proc_tpms.cpp +++ b/firmware/baseband/proc_tpms.cpp @@ -23,6 +23,8 @@ #include "dsp_fir_taps.hpp" +#include "event_m4.hpp" + TPMSProcessor::TPMSProcessor() { decim_0.configure(taps_200k_decim_0.taps, 33554432); decim_1.configure(taps_200k_decim_1.taps, 131072); @@ -55,3 +57,8 @@ void TPMSProcessor::execute(const buffer_c8_t& buffer) { }); } } + +void run() { + EventDispatcher event_dispatcher { std::make_unique() }; + event_dispatcher.run(); +} diff --git a/firmware/baseband/proc_wfm_audio.cpp b/firmware/baseband/proc_wfm_audio.cpp index 98de47b8..0bd8e068 100644 --- a/firmware/baseband/proc_wfm_audio.cpp +++ b/firmware/baseband/proc_wfm_audio.cpp @@ -23,6 +23,8 @@ #include "audio_output.hpp" +#include "event_m4.hpp" + #include void WidebandFMAudio::execute(const buffer_c8_t& buffer) { @@ -122,3 +124,8 @@ void WidebandFMAudio::capture_config(const CaptureConfigMessage& message) { audio_output.set_stream(nullptr); } } + +void run() { + EventDispatcher event_dispatcher { std::make_unique() }; + event_dispatcher.run(); +} diff --git a/firmware/baseband/proc_wideband_spectrum.cpp b/firmware/baseband/proc_wideband_spectrum.cpp index 399cf626..57268198 100644 --- a/firmware/baseband/proc_wideband_spectrum.cpp +++ b/firmware/baseband/proc_wideband_spectrum.cpp @@ -25,6 +25,8 @@ #include "dsp_fft.hpp" +#include "event_m4.hpp" + #include #include @@ -72,3 +74,8 @@ void WidebandSpectrum::on_message(const Message* const message) { break; } } + +void run() { + EventDispatcher event_dispatcher { std::make_unique() }; + event_dispatcher.run(); +}