12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_ROUNDROBINQUANTUM_HPP_ 13 #define INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_ROUNDROBINQUANTUM_HPP_ 32 using Duration = std::chrono::duration<Representation, TickClock::period>;
105 static_assert(DISTORTOS_TICK_FREQUENCY > 0,
"DISTORTOS_TICK_FREQUENCY must be positive and non-zero!");
106 static_assert(DISTORTOS_ROUND_ROBIN_FREQUENCY > 0,
107 "DISTORTOS_ROUND_ROBIN_FREQUENCY must be positive and non-zero!");
111 DISTORTOS_ROUND_ROBIN_FREQUENCY;
114 "DISTORTOS_TICK_FREQUENCY and DISTORTOS_ROUND_ROBIN_FREQUENCY values produce invalid round-robin quantum!");
124 #endif // INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_ROUNDROBINQUANTUM_HPP_ RoundRobinQuantum class is a quantum of time for round-robin scheduling.
Definition: RoundRobinQuantum.hpp:24
bool isZero() const
Convenience function to test whether the quantum is already at 0.
Definition: RoundRobinQuantum.hpp:87
constexpr RoundRobinQuantum()
RoundRobinQuantum's constructor.
Definition: RoundRobinQuantum.hpp:49
Duration get() const
Gets current value of round-robin's quantum.
Definition: RoundRobinQuantum.hpp:76
uint8_t Representation
type of quantum counter
Definition: RoundRobinQuantum.hpp:29
static constexpr Duration getInitial()
Definition: RoundRobinQuantum.hpp:38
Top-level namespace of distortos project.
Definition: buttons.hpp:33
static constexpr auto quantumRawInitializer_
raw initializer value for round-robin quantum, calculated with rounding to nearest
Definition: RoundRobinQuantum.hpp:110
void decrement()
Decrements round-robin's quantum.
Definition: RoundRobinQuantum.hpp:64
void reset()
Resets value of round-robin's quantum.
Definition: RoundRobinQuantum.hpp:98
Duration quantum_
round-robin quantum
Definition: RoundRobinQuantum.hpp:114
std::chrono::duration< Representation, TickClock::period > Duration
duration type used for quantum
Definition: RoundRobinQuantum.hpp:32