13#ifndef CMSIS_PLUS_CHRONO_CLOCKS_H_
14#define CMSIS_PLUS_CHRONO_CLOCKS_H_
24#pragma GCC diagnostic push
26#pragma clang diagnostic ignored "-Wc++98-compat"
27#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
41 template<
typename T,
typename =
void>
75 using period = std::ratio<1, os::rtos::clock_systick::frequency_hz>;
77 using duration = std::chrono::duration<rep, period>;
80 using time_point = std::chrono::time_point<systick_clock>;
106#pragma GCC diagnostic push
107#if defined(__clang__)
108#pragma clang diagnostic ignored "-Wc++98-compat"
110#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
111#pragma clang diagnostic ignored "-Wreserved-identifier"
112#elif defined(__GNUC__)
113#pragma GCC diagnostic ignored "-Waggregate-return"
114#pragma GCC diagnostic ignored "-Wuseless-cast"
118 operator"" _ticks (
unsigned long long t)
123#pragma GCC diagnostic pop
139 using duration = std::chrono::duration<rep, period>;
145 static constexpr const bool is_steady
157 sleep_for (sleep_rep);
176 using rep = duration::rep;
181 static constexpr const bool is_steady
190 to_time_t (const time_point& tp) noexcept;
192 from_time_t (time_t t) noexcept;
211 using rep = duration::rep;
213 using time_point = std::chrono::time_point<high_resolution_clock>;
216 static constexpr const bool is_steady
246 rtos::sysclock.sleep_for (ticks);
254 rtos::rtclock.sleep_for (secs);
259#pragma GCC diagnostic push
260#if defined(__clang__)
261#pragma clang diagnostic ignored "-Wreserved-identifier"
262#elif defined(__GNUC__)
263#pragma GCC diagnostic ignored "-Waggregate-return"
266 template<
class _To,
class Rep_T,
class Period_T>
267 constexpr typename std::enable_if<
268 std::chrono::__is_duration<_To>::value, _To>::type
269 ceil (std::chrono::duration<Rep_T, Period_T> d)
271 using namespace std::chrono;
272 _To r = std::chrono::duration_cast<_To> (d);
280#pragma GCC diagnostic pop
288#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.