diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-07-09 18:49:13 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-07-09 18:50:01 +0200 |
commit | 1e38db8e6d96aeec5231d9614ac9f7605773b596 (patch) | |
tree | 4fb6091bf79d5f1d55b32c11f6df5c4f37430f7b | |
parent | 091a4f626f8c6369638a3d54b8b67d9e225673ad (diff) |
Added synced-flag to PPMSum class.
-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(); }; |