Skip to content
Snippets Groups Projects
Commit d4f38c14 authored by Daniel Friesel's avatar Daniel Friesel
Browse files

use 16bit uint for msp430fr overflow counter

parent c03bff93
No related branches found
No related tags found
No related merge requests found
......@@ -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) {}
......
......@@ -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++;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment