diff --git a/firmware/application/apps/analog_audio_app.cpp b/firmware/application/apps/analog_audio_app.cpp index a1f4e224e..5e0adfd17 100644 --- a/firmware/application/apps/analog_audio_app.cpp +++ b/firmware/application/apps/analog_audio_app.cpp @@ -419,10 +419,10 @@ void AnalogAudioView::on_baseband_bandwidth_changed(uint32_t bandwidth_hz) { } void AnalogAudioView::on_modulation_changed(ReceiverModel::Mode modulation) { - baseband::spectrum_streaming_stop(); + waterfall.stop(); update_modulation(modulation); on_show_options_modulation(); - baseband::spectrum_streaming_start(); + waterfall.start(); } void AnalogAudioView::remove_options_widget() { diff --git a/firmware/application/ui/ui_spectrum.cpp b/firmware/application/ui/ui_spectrum.cpp index 0fcb8c504..0a48e0c37 100644 --- a/firmware/application/ui/ui_spectrum.cpp +++ b/firmware/application/ui/ui_spectrum.cpp @@ -361,6 +361,8 @@ void WaterfallView::stop() { baseband::spectrum_streaming_stop(); running_ = false; } + this->channel_fifo = nullptr; + this->audio_spectrum_data = nullptr; } void WaterfallView::show_audio_spectrum_view(const bool show) { diff --git a/firmware/application/ui/ui_spectrum.hpp b/firmware/application/ui/ui_spectrum.hpp index ecc8988a8..8648d2e90 100644 --- a/firmware/application/ui/ui_spectrum.hpp +++ b/firmware/application/ui/ui_spectrum.hpp @@ -173,12 +173,16 @@ class WaterfallView : public View { MessageHandlerRegistration message_handler_channel_spectrum_config{ Message::ID::ChannelSpectrumConfig, [this](const Message* const p) { + if (!running_) + return; const auto message = *reinterpret_cast(p); this->channel_fifo = message.fifo; }}; MessageHandlerRegistration message_handler_audio_spectrum{ Message::ID::AudioSpectrum, [this](const Message* const p) { + if (!running_) + return; const auto message = *reinterpret_cast(p); this->audio_spectrum_data = message.data; this->audio_spectrum_update = true; @@ -186,6 +190,8 @@ class WaterfallView : public View { MessageHandlerRegistration message_handler_frame_sync{ Message::ID::DisplayFrameSync, [this](const Message* const) { + if (!running_) + return; if (this->channel_fifo) { ChannelSpectrum channel_spectrum; while (channel_fifo->out(channel_spectrum)) {