FastLED 3.9.15
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// IWYU pragma: end_keep
17#endif
18
19namespace fl {
20
21static void sys_yield() {
22 // Pure OS-level yield — no FastLED subsystem pumping.
23#ifdef FL_IS_ESP32
24 vTaskDelay(0);
25#elif FASTLED_MULTITHREADED
26 std::this_thread::yield(); // okay std namespace
27#endif
28 // Single-threaded non-RTOS platforms: no-op
29}
30
31void yield() {
32 sys_yield();
33}
34
35} // namespace fl
Task executor — runs registered task runners and manages the run loop.
void yield()
Yield to the platform scheduler.
Definition yield.cpp.hpp:31
static void sys_yield()
Definition yield.cpp.hpp:21
Base definition for an LED controller.
Definition crgb.hpp:179
Platform-aware cooperative yield for FastLED.