From a4ddf786d4bc0fbf899bae8d42614220bf4c8a7e Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 23 May 2016 11:12:06 -0700 Subject: [PATCH] TPMS: Move only FSK slicer and payload handler into .hpp. --- firmware/baseband/proc_tpms.cpp | 14 -------------- firmware/baseband/proc_tpms.hpp | 10 ++++++---- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/firmware/baseband/proc_tpms.cpp b/firmware/baseband/proc_tpms.cpp index cf061d10..698394dd 100644 --- a/firmware/baseband/proc_tpms.cpp +++ b/firmware/baseband/proc_tpms.cpp @@ -56,17 +56,3 @@ void TPMSProcessor::execute(const buffer_c8_t& buffer) { }); } } - -void TPMSProcessor::consume_symbol( - const float raw_symbol -) { - const uint_fast8_t sliced_symbol = (raw_symbol >= 0.0f) ? 1 : 0; - packet_builder.execute(sliced_symbol); -} - -void TPMSProcessor::payload_handler( - const baseband::Packet& packet -) { - const TPMSPacketMessage message { tpms::SignalType::FLM, packet }; - shared_memory.application_queue.push(message); -} diff --git a/firmware/baseband/proc_tpms.hpp b/firmware/baseband/proc_tpms.hpp index fda7126e..c4044887 100644 --- a/firmware/baseband/proc_tpms.hpp +++ b/firmware/baseband/proc_tpms.hpp @@ -75,14 +75,18 @@ private: clock_recovery::ClockRecovery clock_recovery_fsk_19k2 { 38400, 19200, { 0.0555f }, - [this](const float symbol) { this->consume_symbol(symbol); } + [this](const float raw_symbol) { + const uint_fast8_t sliced_symbol = (raw_symbol >= 0.0f) ? 1 : 0; + this->packet_builder.execute(sliced_symbol); + } }; PacketBuilder packet_builder { { 0b010101010101010101010101010110, 30, 1 }, { }, { 160 }, [this](const baseband::Packet& packet) { - this->payload_handler(packet); + const TPMSPacketMessage message { tpms::SignalType::FLM, packet }; + shared_memory.application_queue.push(message); } }; @@ -119,8 +123,6 @@ private: shared_memory.application_queue.push(message); } }; - void consume_symbol(const float symbol); - void payload_handler(const baseband::Packet& packet); }; #endif/*__PROC_TPMS_H__*/