diff options
author | Daniel Friesel <derf@finalrewind.org> | 2017-12-14 09:35:32 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2017-12-14 09:35:32 +0100 |
commit | 693afffd7b89507916ecd759767b0b7e947dca60 (patch) | |
tree | 386783d9faded12240a3fd06eada7dc3dfd867c1 /include/msp430fr5969lp | |
parent | e9bebe253fdecee009414bdce7ccdfba83f980e6 (diff) |
msp430fr5969lp: Add TIMER_S support
Diffstat (limited to 'include/msp430fr5969lp')
-rw-r--r-- | include/msp430fr5969lp/driver/uptime.h | 10 |
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 ©); +#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; |