From f918a774b76959b59806fd45d17316127245c291 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 28 Sep 2015 11:03:20 -0700 Subject: [PATCH] Address implicit cast compiler warnings. --- firmware/baseband/proc_fsk.cpp | 6 +++++- firmware/baseband/proc_fsk.hpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/firmware/baseband/proc_fsk.cpp b/firmware/baseband/proc_fsk.cpp index f02ef472..889d3e23 100644 --- a/firmware/baseband/proc_fsk.cpp +++ b/firmware/baseband/proc_fsk.cpp @@ -86,7 +86,11 @@ void FSKProcessor::execute(buffer_c8_t buffer) { // TODO: Factor out this hidden decimation magic. for(size_t i=0; i sample { channel.p[i].real(), channel.p[i].imag() }; + // TODO: No idea why implicit cast int16_t->float is not allowed. + const std::complex sample { + static_cast(channel.p[i].real()), + static_cast(channel.p[i].imag()) + }; mf_0.execute_once(sample); if( mf_1.execute_once(sample) ) { const auto value_0 = mf_0.get_output(); diff --git a/firmware/baseband/proc_fsk.hpp b/firmware/baseband/proc_fsk.hpp index 4a41c158..8a675732 100644 --- a/firmware/baseband/proc_fsk.hpp +++ b/firmware/baseband/proc_fsk.hpp @@ -80,7 +80,7 @@ private: }; clock_recovery::ClockRecovery clock_recovery { - sampling_rate / 4, + static_cast(sampling_rate / 4), 9600, [this](const float symbol) { this->consume_symbol(symbol); } };