FastLED 3.10.8
Loading...
Searching...
No Matches
yield.cpp.hpp
Go to the documentation of this file.
1
3
4#include "fl/system/yield.h"
6#include "fl/stl/thread.h"
7
8#if SKETCH_HAS_LARGE_MEMORY
9#include "fl/task/executor.h"
10#endif
11
12#ifdef FL_IS_ESP32
13// IWYU pragma: begin_keep
14#include "freertos/FreeRTOS.h"
15#include "freertos/task.h"
16#include "fl/stl/noexcept.h"
17// IWYU pragma: end_keep
18#endif
19
20namespace fl {
21
22static void sys_yield() FL_NO_EXCEPT {
23 // Pure OS-level yield — no FastLED subsystem pumping.
24#ifdef FL_IS_ESP32
25 vTaskDelay(0);
26#elif FASTLED_MULTITHREADED
27 std::this_thread::yield(); // okay std namespace
28#endif
29 // Single-threaded non-RTOS platforms: no-op
30}
31
33 sys_yield();
34}
35
36} // namespace fl
Task executor — runs registered task runners and manages the run loop.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
static void sys_yield() FL_NO_EXCEPT
Definition yield.cpp.hpp:22
void yield() FL_NO_EXCEPT
Yield to the platform scheduler.
Definition yield.cpp.hpp:32
Base definition for an LED controller.
Definition crgb.hpp:179
Platform-aware cooperative yield for FastLED.