From ad554b28b5d4fac4f9d64ff7f819aa77a516615f Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Tue, 17 May 2016 11:11:30 -0700 Subject: [PATCH] Rename TPMS clock recovery, packet builders for accuracy. --- firmware/baseband/proc_tpms.cpp | 6 +++--- firmware/baseband/proc_tpms.hpp | 9 +++++---- firmware/common/tpms_packet.cpp | 4 ++-- firmware/common/tpms_packet.hpp | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/firmware/baseband/proc_tpms.cpp b/firmware/baseband/proc_tpms.cpp index 9d401a1c..497f466f 100644 --- a/firmware/baseband/proc_tpms.cpp +++ b/firmware/baseband/proc_tpms.cpp @@ -48,10 +48,10 @@ void TPMSProcessor::execute(const buffer_c8_t& buffer) { const auto sliced = ook_slicer_5sps(decim_1_out.p[i]); slicer_history = (slicer_history << 1) | sliced; - ook_clock_recovery_subaru(slicer_history, [this](const bool symbol) { - this->packet_builder_ook_subaru.execute(symbol); + clock_recovery_ook_8k192(slicer_history, [this](const bool symbol) { + this->packet_builder_schrader.execute(symbol); }); - ook_clock_recovery_gmc(slicer_history, [this](const bool symbol) { + clock_recovery_ook_8k4(slicer_history, [this](const bool symbol) { this->packet_builder_ook_gmc.execute(symbol); }); } diff --git a/firmware/baseband/proc_tpms.hpp b/firmware/baseband/proc_tpms.hpp index 759f7383..d9f6f3d5 100644 --- a/firmware/baseband/proc_tpms.hpp +++ b/firmware/baseband/proc_tpms.hpp @@ -92,20 +92,21 @@ private: OOKSlicerMagSquaredInt ook_slicer_5sps { 5 }; uint32_t slicer_history { 0 }; - OOKClockRecovery ook_clock_recovery_subaru { + OOKClockRecovery clock_recovery_ook_8k192 { channel_sample_rate / 8192.0f }; - PacketBuilder packet_builder_ook_subaru { + PacketBuilder packet_builder_schrader { { 0b010101010101010101011110, 24, 0 }, { }, { 80 }, [](const baseband::Packet& packet) { - const TPMSPacketMessage message { tpms::SignalType::Subaru, packet }; + const TPMSPacketMessage message { tpms::SignalType::Schrader, packet }; shared_memory.application_queue.push(message); } }; - OOKClockRecovery ook_clock_recovery_gmc { + + OOKClockRecovery clock_recovery_ook_8k4 { channel_sample_rate / 8400.0f }; diff --git a/firmware/common/tpms_packet.cpp b/firmware/common/tpms_packet.cpp index 7b18622b..0d800232 100644 --- a/firmware/common/tpms_packet.cpp +++ b/firmware/common/tpms_packet.cpp @@ -67,9 +67,9 @@ Optional Packet::reading(const SignalType signal_type) const { } } - if( signal_type == SignalType::Subaru ) { + if( signal_type == SignalType::Schrader ) { return Reading { - Reading::Type::SUB_35, + Reading::Type::Schrader, reader_.read(3, 25), Pressure { static_cast(reader_.read(28, 8)) } }; diff --git a/firmware/common/tpms_packet.hpp b/firmware/common/tpms_packet.hpp index ab9ecf4f..57d8d929 100644 --- a/firmware/common/tpms_packet.hpp +++ b/firmware/common/tpms_packet.hpp @@ -39,7 +39,7 @@ namespace tpms { enum SignalType : uint32_t { FLM = 1, - Subaru = 2, + Schrader = 2, GMC = 3, }; @@ -71,7 +71,7 @@ public: FLM_64 = 1, FLM_72 = 2, FLM_80 = 3, - SUB_35 = 4, + Schrader = 4, GMC_96 = 5, };