28#ifndef CMSIS_PLUS_CHRONO_CLOCKS_H_
29#define CMSIS_PLUS_CHRONO_CLOCKS_H_
48 template<
typename T,
typename =
void>
82 using period = std::ratio<1, os::rtos::clock_systick::frequency_hz>;
84 using duration = std::chrono::duration<rep, period>;
87 using time_point = std::chrono::time_point<systick_clock>;
113#pragma GCC diagnostic push
114#pragma GCC diagnostic ignored "-Waggregate-return"
117 operator"" _ticks (
unsigned long long t)
122#pragma GCC diagnostic pop
138 using duration = std::chrono::duration<rep, period>;
144 static constexpr const bool is_steady
156 sleep_for (sleep_rep);
175 using rep = duration::rep;
180 static constexpr const bool is_steady
189 to_time_t (const time_point& tp) noexcept;
191 from_time_t (time_t t) noexcept;
210 using rep = duration::rep;
212 using time_point = std::chrono::time_point<high_resolution_clock>;
215 static constexpr const bool is_steady
245 rtos::sysclock.sleep_for (ticks);
253 rtos::rtclock.sleep_for (secs);
258#pragma GCC diagnostic push
259#pragma GCC diagnostic ignored "-Waggregate-return"
261 template<
class _To,
class Rep_T,
class Period_T>
262constexpr typename std::enable_if<
263 std::chrono::__is_duration<_To>::value, _To>::type
264 ceil (std::chrono::duration<Rep_T, Period_T> d)
266 using namespace std::chrono;
267 _To r = std::chrono::duration_cast<_To> (d);
275#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.