summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-06-04 17:39:52 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-06-04 17:39:52 +0200
commit094c977b8877d652f629260cc753aacc7000e328 (patch)
tree96443f22bf31e93fd76b3dcef8c6ce57bddc5139 /include
parentd30e3fa68d7192da22c1569f56f564b92896170d (diff)
downloadradio-controller-094c977b8877d652f629260cc753aacc7000e328.tar.gz
radio-controller-094c977b8877d652f629260cc753aacc7000e328.tar.bz2
radio-controller-094c977b8877d652f629260cc753aacc7000e328.tar.xz
radio-controller-094c977b8877d652f629260cc753aacc7000e328.zip
o Daewoo -> Samsung.
Diffstat (limited to 'include')
-rw-r--r--include/decoder.h6
-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();