FastLED 3.10.10
Loading...
Searching...
No Matches
engine_worker_defaults.h
Go to the documentation of this file.
1#pragma once
2
6
7// Optional defaults for engines that opt in. Supply identical build flags in
8// every translation unit; individual peripherals may honor or ignore them.
9// Core uses fl::Core policies; Auto (-1) retains the backend's legacy policy.
10#ifndef FL_ENGINE_WORKER_CORE
11#define FL_ENGINE_WORKER_CORE -1
12#endif
13
14// Portable fl::Priority policy, never a raw scheduler priority. High means
15// at networking priority or above, biased above; Medium is below networking.
16// Low is generally not recommended for timing-sensitive engine workers.
17// Auto (0) retains the backend's existing default: High on the LCD/I2S worker.
18#ifndef FL_ENGINE_WORKER_PRIORITY
19#define FL_ENGINE_WORKER_PRIORITY 0
20#endif
21
22namespace fl {
23namespace detail {
24
25// Accept integer policy values or the matching enum, never fractional values
26// or an unrelated enum whose numeric value happens to fit the range.
31 "FL_ENGINE_WORKER_CORE must be a valid fl::Core policy");
34 "FL_ENGINE_WORKER_PRIORITY must be a valid fl::Priority policy");
35
36// Validate before narrowing into the byte-sized enums (256 must not wrap Auto).
37// Unsigned values are range-checked first: 2^64-3 would otherwise cast to -3.
40 static_cast<fl::u64>(FL_ENGINE_WORKER_CORE) <= 1) &&
41 static_cast<fl::i64>(FL_ENGINE_WORKER_CORE) >= -3 &&
42 static_cast<fl::i64>(FL_ENGINE_WORKER_CORE) <= 1,
43 "FL_ENGINE_WORKER_CORE must be a valid fl::Core policy");
45 static_cast<fl::i64>(FL_ENGINE_WORKER_PRIORITY) <= 3,
46 "FL_ENGINE_WORKER_PRIORITY must be a valid fl::Priority policy");
47
50
51} // namespace detail
52} // namespace fl
#define FL_ENGINE_WORKER_CORE
#define FL_ENGINE_WORKER_PRIORITY
constexpr Core kEngineWorkerDefaultCore
constexpr Priority kEngineWorkerDefaultPriority
fl::decay_t< decltype(FL_ENGINE_WORKER_PRIORITY)> EngineWorkerPriorityType
fl::decay_t< decltype(FL_ENGINE_WORKER_CORE)> EngineWorkerCoreType
typename decay< T >::type decay_t
Definition s16x16x4.h:326
Priority
Portable worker scheduling policy, resolved by the selected backend.
fl::i64 i64
Definition s16x16x4.h:222
Core
Worker task affinity. This does not change peripheral interrupt affinity.
fl::u64 u64
Definition s16x16x4.h:221
Base definition for an LED controller.
#define FL_STATIC_ASSERT(...)
Portable compile-time assertion wrapper.