Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
target_clock.hpp
Go to the documentation of this file.
1/**
2 * @file target_clock.hpp
3 * @brief The target's control clock: Clock over the system timer
4 * @ingroup control
5 *
6 * The source is the system timer (<sbl/system/timer.hpp>), whose tick port
7 * the target mounts by include path. App and library code use TargetClock
8 * so the source type appears in one place.
9 */
10
11#ifndef SBL_CONTROL_TARGET_CLOCK_HPP_
12#define SBL_CONTROL_TARGET_CLOCK_HPP_
13
14#include <cstdint>
15
16#include <sbl/control/clock.hpp>
17#include <sbl/system/timer.hpp>
18
19namespace sbl::control {
20
21/** The system timer as a clock source. */
23 static constexpr uint32_t TICKS_PER_SECOND = sbl::system::timer::rate();
24 static uint32_t now() { return sbl::system::timer::count(); }
25};
26
28
29} // namespace sbl::control
30
31#endif // SBL_CONTROL_TARGET_CLOCK_HPP_
The control clock: the app's one control timebase.
The control stack: scheduler, event queue, merge, CC mapping, calibration.
constexpr uint32_t rate()
Definition timer.hpp:34
uint32_t count()
Definition timer.hpp:37
The system timer: the count, 64-bit time, busy waits and millis()