diff options
-rw-r--r-- | ppmsum.cpp | 3 | ||||
-rw-r--r-- | ppmsum.h | 4 |
2 files changed, 5 insertions, 2 deletions
@@ -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++; @@ -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(); }; |