summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/msp430fr5969lp/driver/uptime.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/msp430fr5969lp/driver/uptime.h b/include/msp430fr5969lp/driver/uptime.h
index eaa7203..a25994d 100644
--- a/include/msp430fr5969lp/driver/uptime.h
+++ b/include/msp430fr5969lp/driver/uptime.h
@@ -7,12 +7,18 @@
class Uptime {
private:
Uptime(const Uptime &copy);
+#ifdef TIMER_S
+ uint16_t seconds;
+#endif
public:
- Uptime () {}
+ Uptime () : seconds(0) {}
inline uint16_t get_us() { return TA0R; }
- inline uint16_t get_s() { return 0; }
inline uint16_t get_cycles() { return TA2R; }
+#ifdef TIMER_S
+ inline uint16_t get_s() { return seconds; }
+ inline void tick_s() { seconds++; }
+#endif
};
extern Uptime uptime;