summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/arch/msp430fr5994lp/driver/counter.h4
-rw-r--r--src/arch/msp430fr5994lp/driver/counter.cc2
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++;
}
}