21#ifndef MMGR_PRAET_HOROLOGIORUM_CUSTOS_H
22#define MMGR_PRAET_HOROLOGIORUM_CUSTOS_H
33#define PRAET_CLOCK_CALLER 1
38#define PRAET_CLOCK_OWN 0
55#define PRAET_CLOCK_HZ 1000000u
56#define PRAET_UNSET_CLOCK_HZ 1
58 "No clock is declared, so PRAET_CLOCK_HZ took the library default of 1000000 and a tick is read as one microsecond. Every deadline in this module is then wrong by whatever the real frequency is. Set it to the frequency of the clock this reads."
71#ifndef PRAET_CLOCK_SOURCE
72#define PRAET_UNSET_CLOCK_SOURCE 1
73#if PRAET_PLATFORM_HAS_CYCLE_COUNTER
74#define PRAET_CLOCK_SOURCE PRAET_CLOCK_OWN
76 "PRAET_CLOCK_SOURCE was not set and was derived as PRAET_CLOCK_OWN, because this architecture defines a cycle counter a port can read. Say so, or set PRAET_CLOCK_CALLER to have this read a clock you already run."
78#define PRAET_CLOCK_SOURCE PRAET_CLOCK_CALLER
80 "PRAET_CLOCK_SOURCE was not set and was derived as PRAET_CLOCK_CALLER, because this architecture defines no cycle counter a timer could be pinned to. Say so, and supply the clock."
86#if (PRAET_CLOCK_SOURCE != PRAET_CLOCK_CALLER) && (PRAET_CLOCK_SOURCE != PRAET_CLOCK_OWN)
87#error "PRAET_CLOCK_SOURCE must be PRAET_CLOCK_CALLER or PRAET_CLOCK_OWN."
93#if (PRAET_CLOCK_SOURCE == PRAET_CLOCK_OWN) && !PRAET_PLATFORM_HAS_CYCLE_COUNTER
95 "PRAET_CLOCK_SOURCE is PRAET_CLOCK_OWN, but this architecture defines no cycle counter for this to pin a timer to. Set PRAET_CLOCK_SOURCE to PRAET_CLOCK_CALLER and supply the clock. An ARMv6-M part and a host build both land here."
98#if PRAET_CLOCK_SOURCE == PRAET_CLOCK_OWN
108#ifndef PRAET_CLOCK_CORE
109#define PRAET_CLOCK_CORE PRAET_PLATFORM_CLOCK_CORE
110#define PRAET_UNSET_CLOCK_CORE 1
112 "PRAET_CLOCK_CORE was not set and took PRAET_PLATFORM_CLOCK_CORE, which is core zero on every family this library targets. Set it to the core this should pin its timer to."
119#ifdef PRAET_CLOCK_CORE
121 "PRAET_CLOCK_CORE is set but PRAET_CLOCK_SOURCE is PRAET_CLOCK_CALLER. Nothing pins a timer in this build, so there is no core to pin it to. Set PRAET_CLOCK_SOURCE to PRAET_CLOCK_OWN, or take PRAET_CLOCK_CORE out."
132#define PRAET_TICKS_PER_MICRO (PRAET_CLOCK_HZ / 1000000u)
142#define PRAET_CLOCK_MICROS(ticks_) ((ticks_) / (embed_word)PRAET_TICKS_PER_MICRO)
148 "PRAET_CLOCK_HZ is not a whole number of megahertz, and this module scales in whole ticks");
151 "PRAET_CLOCK_HZ is below one megahertz, which cannot resolve the microsecond deadlines this "
152 "module is written in");
The embedded_types headers every module builds on.
#define PRAET_CLOCK_HZ
Ticks the clock counts in one second.
#define PRAET_TICKS_PER_MICRO
Ticks this clock counts in one microsecond.
Every knob this module reads, what it takes when the caller did not set it, and the warning that says...