diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-02-08 13:46:48 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-02-08 13:46:48 +0100 |
commit | ec871ef8ae230bcb779c8535c3c4526817fd5d93 (patch) | |
tree | 558e731639f7ece070d7abd14c3c82afa11f9647 /include/arch/stm32f746zg-nucleo/driver/uptime.h | |
parent | 18db600341bcf1c21e4282515d458b898639f349 (diff) |
Add preliminary STM32F746ZG-Nucleo support
Diffstat (limited to 'include/arch/stm32f746zg-nucleo/driver/uptime.h')
-rw-r--r-- | include/arch/stm32f746zg-nucleo/driver/uptime.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/arch/stm32f746zg-nucleo/driver/uptime.h b/include/arch/stm32f746zg-nucleo/driver/uptime.h new file mode 100644 index 0000000..cae3424 --- /dev/null +++ b/include/arch/stm32f746zg-nucleo/driver/uptime.h @@ -0,0 +1,32 @@ +/* + * Copyright 2024 Birte Kristina Friesel + * + * SPDX-License-Identifier: BSD-2-Clause + */ +#ifndef UPTIME_H +#define UPTIME_H + +#include <stdint.h> + +class Uptime { + private: + Uptime(const Uptime ©); +#ifdef TIMER_S + uint32_t seconds; +#endif + + public: +#ifdef TIMER_S + Uptime () : seconds(0) {} +#else + Uptime () {} +#endif +#ifdef TIMER_S + inline uint32_t get_s() { return seconds; } + inline void tick_s() { seconds++; } +#endif +}; + +extern Uptime uptime; + +#endif |