diff --git a/firmware/application/manchester.cpp b/firmware/application/manchester.cpp index 95205043..877fc03b 100644 --- a/firmware/application/manchester.cpp +++ b/firmware/application/manchester.cpp @@ -24,6 +24,21 @@ // TODO: SERIOUSLY!? Including this, just to use to_string_hex?! Refactor!!!1 #include "ui_widget.hpp" +ManchesterDecoder::DecodedSymbol ManchesterDecoder::operator[](const size_t index) const { + const size_t encoded_index = index * 2; + if( (encoded_index + 1) < count ) { + const auto value = encoded[encoded_index + sense]; + const auto error = encoded[encoded_index + 0] == encoded[encoded_index + 1]; + return { value, error }; + } else { + return { 0, 1 }; + } +} + +size_t ManchesterDecoder::symbols_count() const { + return count / 2; +} + ManchesterFormatted format_manchester( const ManchesterDecoder& decoder ) { diff --git a/firmware/application/manchester.hpp b/firmware/application/manchester.hpp index 15762a55..5e965c85 100644 --- a/firmware/application/manchester.hpp +++ b/firmware/application/manchester.hpp @@ -44,20 +44,9 @@ public: { } - DecodedSymbol operator[](const size_t index) const { - const size_t encoded_index = index * 2; - if( (encoded_index + 1) < count ) { - const auto value = encoded[encoded_index + sense]; - const auto error = encoded[encoded_index + 0] == encoded[encoded_index + 1]; - return { value, error }; - } else { - return { 0, 1 }; - } - } + DecodedSymbol operator[](const size_t index) const; - size_t symbols_count() const { - return count / 2; - } + size_t symbols_count() const; private: const std::bitset<1024>& encoded;