|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Named values written under one tag, on change, at a capped rate. More...
Named values written under one tag, on change, at a capped rate.
| COUNT | Number of values |
| LINE | Line buffer size; a write that needs more is split into several lines |
Definition at line 182 of file tagged.hpp.
#include <tagged.hpp>
Public Member Functions | |
| TaggedValues (const char *tag, const char *const (&names)[COUNT]) | |
| TaggedValues (const char *tag) | |
| void | name (size_t index, const char *key) |
| void | set_interval_ms (uint32_t ms) |
| void | set_threshold (float threshold) |
| void | set_decimals (uint8_t decimals) |
| void | set (size_t index, float value) |
| float | value (size_t index) const |
| void | force () |
| template<typename Output > | |
| bool | poll (uint32_t now_ms) |
| Write the values if one moved and the interval has passed. | |
Static Public Attributes | |
| static constexpr uint32_t | DEFAULT_INTERVAL_MS = 33 |
| static constexpr float | DEFAULT_THRESHOLD = 1.0f / 1024.0f |
|
inline |
| tag | The line's tag, e.g. "WATCH" |
| names | Key for each value: [a-z][a-z0-9_]* |
Definition at line 196 of file tagged.hpp.
References sbl::log::is_sink_v.
|
inlineexplicit |
Values named one at a time with name().
Definition at line 203 of file tagged.hpp.
Set the key of one value: [a-z][a-z0-9_]*.
Definition at line 206 of file tagged.hpp.
References sbl::log::is_sink_v.
|
inline |
Definition at line 212 of file tagged.hpp.
|
inline |
Definition at line 213 of file tagged.hpp.
|
inline |
Definition at line 214 of file tagged.hpp.
|
inline |
Take a value's current reading.
Definition at line 217 of file tagged.hpp.
References sbl::log::is_sink_v.
|
inline |
Definition at line 228 of file tagged.hpp.
|
inline |
Write every value at the next poll, whether it moved or not.
Definition at line 231 of file tagged.hpp.
|
inline |
Write the values if one moved and the interval has passed.
| now_ms | A millisecond clock; wraparound is handled |
Definition at line 243 of file tagged.hpp.
References sbl::log::is_sink_v.
|
staticconstexpr |
Minimum time between writes, 33 ms (about 30 lines a second).
Definition at line 187 of file tagged.hpp.
|
staticconstexpr |
A change smaller than this, in the values' own unit, is not written.
Definition at line 190 of file tagged.hpp.