diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/decoder.h | 6 | ||||
-rw-r--r-- | include/samsung_decoder.h (renamed from include/daewoo_decoder.h) | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/include/decoder.h b/include/decoder.h index 55e7d96..56ea647 100644 --- a/include/decoder.h +++ b/include/decoder.h @@ -1,5 +1,7 @@ #pragma once +#include <cstdint> + namespace radio_controller { struct sample { @@ -26,7 +28,8 @@ class bit_string final { int size_ = 0; public: - int size() const { + int size() const + { return size_; } @@ -42,7 +45,6 @@ public: } } - __noinline void append(bool value) { if (size_ < 32) { diff --git a/include/daewoo_decoder.h b/include/samsung_decoder.h index b790a1a..52978ec 100644 --- a/include/daewoo_decoder.h +++ b/include/samsung_decoder.h @@ -1,10 +1,12 @@ #pragma +#include <cstdint> +#include <cstdio> #include "decoder.h" namespace radio_controller { -class daewoo_decoder : public decoder { +class samsung_decoder : public decoder { inline bool between(uint16_t smallest, uint16_t biggest, uint16_t value) @@ -41,8 +43,8 @@ class daewoo_decoder : public decoder { return check_pulse<1125, 560>(s); } - __noinline - void dump_values(sample_iterator *it) { + void dump_values(sample_iterator *it) + { while (it->next()) { auto s = it->value(); auto pct = int(s.pulse_us / double(s.period_us) * 100); @@ -53,10 +55,9 @@ class daewoo_decoder : public decoder { public: - __noinline decoding_result decode(sample_iterator *it) override { - printf("Daewoo, size=%d\n", it->size()); + printf("Samsung, size=%d\n", it->size()); dump_values(it); it->reset(); |