10#define M_PI 3.14159265358979323846
17 return static_cast<std::underlying_type_t<T>
>(value);
20template <
class T>
constexpr T
clamp(T x, T a, T b) {
21 return std::min(std::max(x, a), b);
25 x = std::fmod(x, 2 *
M_PI);
39 return osMutexAcquire(mutex_, timeout) == osOK;
Definition utility.hpp:32
ScopedLock(osMutexId_t mutex)
Definition utility.hpp:34
~ScopedLock()
Definition utility.hpp:36
bool acquire(uint32_t timeout)
Definition utility.hpp:38
constexpr T clamp(T x, T a, T b)
Definition utility.hpp:20
constexpr std::underlying_type_t< T > to_underlying(T value) noexcept
Definition utility.hpp:16
constexpr T normalize_angle(T x)
Definition utility.hpp:24
#define M_PI
Definition utility.hpp:10