From 3d222226892d9e630e78ff4a34fbd5f088d10397 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 30 May 2016 11:23:13 -0700 Subject: [PATCH] Extract DecodedSymbol from ManchesterDecoder. --- firmware/common/manchester.cpp | 2 +- firmware/common/manchester.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/firmware/common/manchester.cpp b/firmware/common/manchester.cpp index 3862facc..c6d1cb9b 100644 --- a/firmware/common/manchester.cpp +++ b/firmware/common/manchester.cpp @@ -23,7 +23,7 @@ #include "string_format.hpp" -ManchesterDecoder::DecodedSymbol ManchesterDecoder::operator[](const size_t index) const { +DecodedSymbol ManchesterDecoder::operator[](const size_t index) const { const size_t encoded_index = index * 2; if( (encoded_index + 1) < packet.size() ) { const auto value = packet[encoded_index + sense]; diff --git a/firmware/common/manchester.hpp b/firmware/common/manchester.hpp index 50cae73f..c2bc820d 100644 --- a/firmware/common/manchester.hpp +++ b/firmware/common/manchester.hpp @@ -29,13 +29,13 @@ #include "baseband_packet.hpp" +struct DecodedSymbol { + uint_fast8_t value; + uint_fast8_t error; +}; + class ManchesterDecoder { public: - struct DecodedSymbol { - uint_fast8_t value; - uint_fast8_t error; - }; - constexpr ManchesterDecoder( const baseband::Packet& packet, const size_t sense = 0 @@ -54,7 +54,7 @@ private: }; template -T operator|(const T& l, const ManchesterDecoder::DecodedSymbol& r) { +T operator|(const T& l, const DecodedSymbol& r) { return l | r.value; }