Formatted code (#1007)

* Updated style

* Updated files

* fixed new line

* Updated spacing

* File fix WIP

* Updated to clang 13

* updated comment style

* Removed old comment code
This commit is contained in:
jLynx
2023-05-19 08:16:05 +12:00
committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
599 changed files with 70746 additions and 66896 deletions

View File

@@ -30,57 +30,55 @@
#include "baseband_packet.hpp"
struct DecodedSymbol {
uint_fast8_t value;
uint_fast8_t error;
uint_fast8_t value;
uint_fast8_t error;
};
class ManchesterBase {
public:
constexpr ManchesterBase(
const baseband::Packet& packet,
const size_t sense = 0
) : packet { packet },
sense { sense }
{
}
virtual DecodedSymbol operator[](const size_t index) const = 0;
public:
constexpr ManchesterBase(
const baseband::Packet& packet,
const size_t sense = 0)
: packet{packet},
sense{sense} {
}
virtual size_t symbols_count() const;
virtual ~ManchesterBase() { };
protected:
const baseband::Packet& packet;
const size_t sense;
virtual DecodedSymbol operator[](const size_t index) const = 0;
virtual size_t symbols_count() const;
virtual ~ManchesterBase(){};
protected:
const baseband::Packet& packet;
const size_t sense;
};
class ManchesterDecoder : public ManchesterBase {
public:
using ManchesterBase::ManchesterBase;
DecodedSymbol operator[](const size_t index) const;
public:
using ManchesterBase::ManchesterBase;
DecodedSymbol operator[](const size_t index) const;
};
class BiphaseMDecoder : public ManchesterBase {
public:
using ManchesterBase::ManchesterBase;
DecodedSymbol operator[](const size_t index) const;
public:
using ManchesterBase::ManchesterBase;
DecodedSymbol operator[](const size_t index) const;
};
template<typename T>
template <typename T>
T operator|(const T& l, const DecodedSymbol& r) {
return l | r.value;
return l | r.value;
}
struct FormattedSymbols {
const std::string data;
const std::string errors;
const std::string data;
const std::string errors;
};
FormattedSymbols format_symbols(
const ManchesterBase& decoder
);
const ManchesterBase& decoder);
void manchester_encode(uint8_t * dest, uint8_t * src, const size_t length, const size_t sense = 0);
void manchester_encode(uint8_t* dest, uint8_t* src, const size_t length, const size_t sense = 0);
#endif/*__MANCHESTER_H__*/
#endif /*__MANCHESTER_H__*/