diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-10-23 13:35:02 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-10-23 13:35:02 +0200 |
commit | d4f38c14cd22131ba20e3ff5d30fcc43c6fc5b2f (patch) | |
tree | 4311baee825019bad488b32f97837449c31e9c85 | |
parent | c03bff934c656cf0d0d986cee75f002aeab5634e (diff) |
use 16bit uint for msp430fr overflow counter
-rw-r--r-- | include/arch/msp430fr5994lp/driver/counter.h | 4 | ||||
-rw-r--r-- | src/arch/msp430fr5994lp/driver/counter.cc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/arch/msp430fr5994lp/driver/counter.h b/include/arch/msp430fr5994lp/driver/counter.h index 1d7800a..429de39 100644 --- a/include/arch/msp430fr5994lp/driver/counter.h +++ b/include/arch/msp430fr5994lp/driver/counter.h @@ -5,7 +5,7 @@ #include <stdint.h> typedef uint16_t counter_value_t; -typedef uint8_t counter_overflow_t; +typedef uint16_t counter_overflow_t; class Counter { private: @@ -13,7 +13,7 @@ class Counter { public: uint16_t value; - volatile uint8_t overflow; + volatile uint16_t overflow; Counter() : overflow(0) {} diff --git a/src/arch/msp430fr5994lp/driver/counter.cc b/src/arch/msp430fr5994lp/driver/counter.cc index daa7a2d..d69d844 100644 --- a/src/arch/msp430fr5994lp/driver/counter.cc +++ b/src/arch/msp430fr5994lp/driver/counter.cc @@ -6,7 +6,7 @@ Counter counter; __attribute__((interrupt(TIMER2_A1_VECTOR))) void handle_timer2_overflow() { if (TA2IV == 0x0e) { - if (counter.overflow < 255) { + if (counter.overflow < 65535) { counter.overflow++; } } |