diff --git a/firmware/baseband/baseband_thread.cpp b/firmware/baseband/baseband_thread.cpp index 27d4b033a..0f575ad68 100644 --- a/firmware/baseband/baseband_thread.cpp +++ b/firmware/baseband/baseband_thread.cpp @@ -101,6 +101,10 @@ void BasebandThread::run() { ); //baseband::dma::allocate(4, 2048); + baseband_sgpio.configure(direction()); + baseband::dma::enable(direction()); + baseband_sgpio.streaming_enable(); + while( !chThdShouldTerminate() ) { // TODO: Place correct sampling rate into buffer returned here: const auto buffer_tmp = baseband::dma::wait_for_rx_buffer(); @@ -114,6 +118,10 @@ void BasebandThread::run() { } } } + + i2s::i2s0::tx_mute(); + baseband::dma::disable(); + baseband_sgpio.streaming_disable(); } BasebandProcessor* BasebandThread::create_processor(const int32_t mode) { @@ -129,19 +137,3 @@ BasebandProcessor* BasebandThread::create_processor(const int32_t mode) { default: return nullptr; } } - -void BasebandThread::disable() { - if( baseband_processor ) { - i2s::i2s0::tx_mute(); - baseband::dma::disable(); - baseband_sgpio.streaming_disable(); - } -} - -void BasebandThread::enable() { - if( baseband_processor ) { - baseband_sgpio.configure(direction()); - baseband::dma::enable(direction()); - baseband_sgpio.streaming_enable(); - } -} diff --git a/firmware/baseband/baseband_thread.hpp b/firmware/baseband/baseband_thread.hpp index 828620494..ce09a51b8 100644 --- a/firmware/baseband/baseband_thread.hpp +++ b/firmware/baseband/baseband_thread.hpp @@ -52,9 +52,6 @@ private: BasebandProcessor* create_processor(const int32_t mode); - void disable(); - void enable(); - void set_configuration(const BasebandConfiguration& new_configuration); };