From 3e0831801216c95620bfbbd7754c33808dbc33eb Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 27 Apr 2016 10:31:37 -0700 Subject: [PATCH] Pass CaptureConfig to StreamInput as pointer. --- firmware/baseband/proc_am_audio.cpp | 2 +- firmware/baseband/proc_capture.cpp | 2 +- firmware/baseband/proc_nfm_audio.cpp | 2 +- firmware/baseband/proc_wfm_audio.cpp | 2 +- firmware/baseband/stream_input.hpp | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/firmware/baseband/proc_am_audio.cpp b/firmware/baseband/proc_am_audio.cpp index 865ea260..f4cb2fac 100644 --- a/firmware/baseband/proc_am_audio.cpp +++ b/firmware/baseband/proc_am_audio.cpp @@ -100,7 +100,7 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) { void NarrowbandAMAudio::capture_config(const CaptureConfigMessage& message) { if( message.config ) { - audio_output.set_stream(std::make_unique(*message.config)); + audio_output.set_stream(std::make_unique(message.config)); } else { audio_output.set_stream(nullptr); } diff --git a/firmware/baseband/proc_capture.cpp b/firmware/baseband/proc_capture.cpp index bcb30dd9..56f6a948 100644 --- a/firmware/baseband/proc_capture.cpp +++ b/firmware/baseband/proc_capture.cpp @@ -85,7 +85,7 @@ void CaptureProcessor::on_message(const Message* const message) { void CaptureProcessor::capture_config(const CaptureConfigMessage& message) { if( message.config ) { - stream = std::make_unique(*message.config); + stream = std::make_unique(message.config); } else { stream.reset(); } diff --git a/firmware/baseband/proc_nfm_audio.cpp b/firmware/baseband/proc_nfm_audio.cpp index 190ed4b0..122115fa 100644 --- a/firmware/baseband/proc_nfm_audio.cpp +++ b/firmware/baseband/proc_nfm_audio.cpp @@ -88,7 +88,7 @@ void NarrowbandFMAudio::configure(const NBFMConfigureMessage& message) { void NarrowbandFMAudio::capture_config(const CaptureConfigMessage& message) { if( message.config ) { - audio_output.set_stream(std::make_unique(*message.config)); + audio_output.set_stream(std::make_unique(message.config)); } else { audio_output.set_stream(nullptr); } diff --git a/firmware/baseband/proc_wfm_audio.cpp b/firmware/baseband/proc_wfm_audio.cpp index 1db24b4c..98de47b8 100644 --- a/firmware/baseband/proc_wfm_audio.cpp +++ b/firmware/baseband/proc_wfm_audio.cpp @@ -117,7 +117,7 @@ void WidebandFMAudio::configure(const WFMConfigureMessage& message) { void WidebandFMAudio::capture_config(const CaptureConfigMessage& message) { if( message.config ) { - audio_output.set_stream(std::make_unique(*message.config)); + audio_output.set_stream(std::make_unique(message.config)); } else { audio_output.set_stream(nullptr); } diff --git a/firmware/baseband/stream_input.hpp b/firmware/baseband/stream_input.hpp index db5f353d..7b93f94f 100644 --- a/firmware/baseband/stream_input.hpp +++ b/firmware/baseband/stream_input.hpp @@ -34,13 +34,13 @@ using namespace lpc43xx; class StreamInput { public: - StreamInput(CaptureConfig& config) : - K { config.write_size_log2 + config.buffer_count_log2 }, - event_bytes_mask { (1UL << config.write_size_log2) - 1 }, + StreamInput(CaptureConfig* const config) : + K { config->write_size_log2 + config->buffer_count_log2 }, + event_bytes_mask { (1UL << config->write_size_log2) - 1 }, data { std::make_unique(1UL << K) }, fifo { data.get(), K } { - config.fifo = &fifo; + config->fifo = &fifo; } size_t write(const void* const data, const size_t length) {