mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-13 18:19:33 +00:00
fix audio mode change crash (#3111)
This commit is contained in:
@@ -419,10 +419,10 @@ void AnalogAudioView::on_baseband_bandwidth_changed(uint32_t bandwidth_hz) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AnalogAudioView::on_modulation_changed(ReceiverModel::Mode modulation) {
|
void AnalogAudioView::on_modulation_changed(ReceiverModel::Mode modulation) {
|
||||||
baseband::spectrum_streaming_stop();
|
waterfall.stop();
|
||||||
update_modulation(modulation);
|
update_modulation(modulation);
|
||||||
on_show_options_modulation();
|
on_show_options_modulation();
|
||||||
baseband::spectrum_streaming_start();
|
waterfall.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalogAudioView::remove_options_widget() {
|
void AnalogAudioView::remove_options_widget() {
|
||||||
|
|||||||
@@ -361,6 +361,8 @@ void WaterfallView::stop() {
|
|||||||
baseband::spectrum_streaming_stop();
|
baseband::spectrum_streaming_stop();
|
||||||
running_ = false;
|
running_ = false;
|
||||||
}
|
}
|
||||||
|
this->channel_fifo = nullptr;
|
||||||
|
this->audio_spectrum_data = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaterfallView::show_audio_spectrum_view(const bool show) {
|
void WaterfallView::show_audio_spectrum_view(const bool show) {
|
||||||
|
|||||||
@@ -173,12 +173,16 @@ class WaterfallView : public View {
|
|||||||
MessageHandlerRegistration message_handler_channel_spectrum_config{
|
MessageHandlerRegistration message_handler_channel_spectrum_config{
|
||||||
Message::ID::ChannelSpectrumConfig,
|
Message::ID::ChannelSpectrumConfig,
|
||||||
[this](const Message* const p) {
|
[this](const Message* const p) {
|
||||||
|
if (!running_)
|
||||||
|
return;
|
||||||
const auto message = *reinterpret_cast<const ChannelSpectrumConfigMessage*>(p);
|
const auto message = *reinterpret_cast<const ChannelSpectrumConfigMessage*>(p);
|
||||||
this->channel_fifo = message.fifo;
|
this->channel_fifo = message.fifo;
|
||||||
}};
|
}};
|
||||||
MessageHandlerRegistration message_handler_audio_spectrum{
|
MessageHandlerRegistration message_handler_audio_spectrum{
|
||||||
Message::ID::AudioSpectrum,
|
Message::ID::AudioSpectrum,
|
||||||
[this](const Message* const p) {
|
[this](const Message* const p) {
|
||||||
|
if (!running_)
|
||||||
|
return;
|
||||||
const auto message = *reinterpret_cast<const AudioSpectrumMessage*>(p);
|
const auto message = *reinterpret_cast<const AudioSpectrumMessage*>(p);
|
||||||
this->audio_spectrum_data = message.data;
|
this->audio_spectrum_data = message.data;
|
||||||
this->audio_spectrum_update = true;
|
this->audio_spectrum_update = true;
|
||||||
@@ -186,6 +190,8 @@ class WaterfallView : public View {
|
|||||||
MessageHandlerRegistration message_handler_frame_sync{
|
MessageHandlerRegistration message_handler_frame_sync{
|
||||||
Message::ID::DisplayFrameSync,
|
Message::ID::DisplayFrameSync,
|
||||||
[this](const Message* const) {
|
[this](const Message* const) {
|
||||||
|
if (!running_)
|
||||||
|
return;
|
||||||
if (this->channel_fifo) {
|
if (this->channel_fifo) {
|
||||||
ChannelSpectrum channel_spectrum;
|
ChannelSpectrum channel_spectrum;
|
||||||
while (channel_fifo->out(channel_spectrum)) {
|
while (channel_fifo->out(channel_spectrum)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user