summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ppmsum.cpp3
-rw-r--r--ppmsum.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/ppmsum.cpp b/ppmsum.cpp
index 3da7d78..75faa17 100644
--- a/ppmsum.cpp
+++ b/ppmsum.cpp
@@ -21,12 +21,13 @@ void PPMSum::irq() {
if(sr & 0x01) {
// Timeout.
- // TODO: Indicate failsafe.
+ synced = false;
} else if(sr & 0x02) {
// Period.
if(TIM4.CCR1 > 5000) {
+ synced = true;
index = 0;
} else {
index++;
diff --git a/ppmsum.h b/ppmsum.h
index 3c4ce79..efc7287 100644
--- a/ppmsum.h
+++ b/ppmsum.h
@@ -11,7 +11,6 @@ class PPMSum {
static PPMSum* self;
uint8_t index;
- uint16_t channels[16];
void irq();
@@ -20,6 +19,9 @@ class PPMSum {
self = this;
}
+ bool synced;
+ uint16_t channels[16];
+
void enable();
};