FastLED 3.10.6
Loading...
Searching...
No Matches

◆ default_bus_priority()

int fl::default_bus_priority ( Bus b,
fl::u8 which )
constexpr

Default priority assigned to a Bus when registered with the manager.

Higher = preferred. The function is constexpr so callers can use it in constant expressions if needed. Buses without a registered priority fall back to 0.

Definition at line 38 of file bus_priorities.h.

38 {
39 // FORCE-style overrides (FASTLED_ESP32_FORCE_*) are intentionally not
40 // applied here -- the legacy initChannelDrivers() retains its own
41 // priority-bumping logic for backward compatibility. This table is the
42 // baseline used by the new enableDrivers<>() opt-in API.
43 //
44 // Secondary FLEX_IO instances sit one below the primary so the
45 // manager fills the primary bank first and overflows to the
46 // secondary (classic-ESP32 I2S0 second bank, ESP32-P4 LCD_RGB —
47 // FastLED#3576 Phase 1).
48 return
49 b == Bus::FLEX_IO ? (which == 0 ? 4 : which == 1 ? 3 : 2) :
50 b == Bus::RMT ? 2 :
51 b == Bus::SPI ? 1 :
52 b == Bus::DUAL_SPI ? 1 :
53 b == Bus::QUAD_SPI ? 1 :
54 b == Bus::OCTAL_SPI ? 1 :
55 b == Bus::BIT_BANG ? 0 :
56 b == Bus::UART ? (which == 0 ? -1 : -2) :
57 0;
58}
Bus
Portable public bus selector.
Definition bus.h:27
@ FLEX_IO
Definition bus.h:36
@ DUAL_SPI
Definition bus.h:32
@ QUAD_SPI
Definition bus.h:33
@ SPI
Definition bus.h:31
@ OCTAL_SPI
Definition bus.h:34
@ BIT_BANG
Definition bus.h:29
@ RMT
Definition bus.h:35
@ UART
Definition bus.h:30

References BIT_BANG, DUAL_SPI, FL_NO_EXCEPT, FLEX_IO, OCTAL_SPI, QUAD_SPI, RMT, SPI, and UART.