diff options
Diffstat (limited to 'include/arch/msp430fr5969lp')
-rw-r--r-- | include/arch/msp430fr5969lp/driver/counter.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/arch/msp430fr5969lp/driver/counter.h b/include/arch/msp430fr5969lp/driver/counter.h index 501808b..b95aba1 100644 --- a/include/arch/msp430fr5969lp/driver/counter.h +++ b/include/arch/msp430fr5969lp/driver/counter.h @@ -1,8 +1,11 @@ +#ifndef COUNTER_H +#define COUNTER_H + #include <msp430.h> #include <stdint.h> -typedef counter_value_t uint16_t; -typedef counter_overflowed_t uint8_t; +typedef uint16_t counter_value_t; +typedef uint8_t counter_overflow_t; class Counter { private: @@ -10,12 +13,12 @@ class Counter { public: uint16_t value; - uint8_t overflowed; + uint8_t overflow; - Counter() : overflowed(0) {} + Counter() : overflow(0) {} inline void start() { - overflowed = 0; + overflow = 0; TA2CTL = TASSEL__SMCLK | ID__1 | MC__CONTINUOUS; TA2EX0 = 0; TA2CTL |= TACLR; @@ -28,3 +31,5 @@ class Counter { }; extern Counter counter; + +#endif |