From c52de7abe69c2b12df8c1df765fb2665a9c7da92 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Tue, 1 Sep 2015 21:05:32 -0700 Subject: [PATCH] Clean up baseband/RSSI streaming control. Address hang-up of baseband and RSSI when switching modulation modes really fast. --- firmware/baseband/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp index 8952dcca..4ef32f73 100755 --- a/firmware/baseband/main.cpp +++ b/firmware/baseband/main.cpp @@ -278,6 +278,11 @@ int main(void) { auto message = reinterpret_cast(p); if( message->configuration.mode != baseband_configuration.mode ) { + if( baseband_processor ) { + baseband::dma::disable(); + rf::rssi::stop(); + } + // TODO: Timing problem around disabling DMA and nulling and deleting old processor auto old_p = baseband_processor; baseband_processor = nullptr; @@ -313,9 +318,6 @@ int main(void) { rf::rssi::start(); } baseband::dma::enable(direction); - } else { - baseband::dma::disable(); - rf::rssi::stop(); } }