28#ifndef CMSIS_PLUS_CHRONO_CLOCKS_H_
29#define CMSIS_PLUS_CHRONO_CLOCKS_H_
39#pragma GCC diagnostic push
42#pragma clang diagnostic ignored "-Wc++98-compat"
43#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
57 template<
typename T,
typename =
void>
91 using period = std::ratio<1, os::rtos::clock_systick::frequency_hz>;
93 using duration = std::chrono::duration<rep, period>;
96 using time_point = std::chrono::time_point<systick_clock>;
122#pragma GCC diagnostic push
123#pragma GCC diagnostic ignored "-Waggregate-return"
124#if defined(__clang__)
125#pragma clang diagnostic ignored "-Wc++98-compat"
127#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
131 operator"" _ticks (
unsigned long long t)
136#pragma GCC diagnostic pop
152 using duration = std::chrono::duration<rep, period>;
158 static constexpr const bool is_steady
170 sleep_for (sleep_rep);
189 using rep = duration::rep;
194 static constexpr const bool is_steady
203 to_time_t (const time_point& tp) noexcept;
205 from_time_t (time_t t) noexcept;
224 using rep = duration::rep;
226 using time_point = std::chrono::time_point<high_resolution_clock>;
229 static constexpr const bool is_steady
259 rtos::sysclock.sleep_for (ticks);
267 rtos::rtclock.sleep_for (secs);
272#pragma GCC diagnostic push
273#pragma GCC diagnostic ignored "-Waggregate-return"
275 template<
class _To,
class Rep_T,
class Period_T>
276constexpr typename std::enable_if<
277 std::chrono::__is_duration<_To>::value, _To>::type
278 ceil (std::chrono::duration<Rep_T, Period_T> d)
280 using namespace std::chrono;
281 _To r = std::chrono::duration_cast<_To> (d);
289#pragma GCC diagnostic pop
297#pragma GCC diagnostic pop
std::chrono::time_point< high_resolution_clock > time_point
std::chrono::nanoseconds duration
rtos::clock_rtc::duration_t sleep_rep
std::chrono::duration< sleep_rep, period > sleep_duration
std::chrono::duration< rep, period > duration
basic duration type of clock
std::ratio< 1, 1 > period
std::ratio type representing the tick period of the clock, in seconds
std::chrono::time_point< realtime_clock > time_point
rtos::clock_rtc::timestamp_t rep
std::chrono::time_point< system_clock > time_point
std::chrono::microseconds duration
std::ratio< 1, os::rtos::clock_systick::frequency_hz > period
std::ratio type representing the tick period of the clock, in seconds
static void sleep_for(sleep_rep ticks)
static constexpr bool is_steady
rtos::clock_systick::duration_t sleep_rep
std::chrono::time_point< systick_clock > time_point
basic time_point type of clock
rtos::clock_systick::timestamp_t rep
type of variable holding the tick counter
static time_point now() noexcept
std::chrono::duration< sleep_rep, period > sleep_duration
std::chrono::duration< rep, period > duration
basic duration type of clock
port::clock::duration_t duration_t
Type of variables holding clock durations.
port::clock::timestamp_t timestamp_t
Type of variables holding clock time stamps.
systick_clock::duration systicks
constexpr std::enable_if< std::chrono::__is_duration< _To >::value, _To >::type ceil(std::chrono::duration< Rep_T, Period_T > d)
Single file µOS++ RTOS definitions.