From 865e3dcd0c8946c6987929e1d9981a8b30c0196e Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sun, 25 Aug 2024 12:53:23 +0200 Subject: [PATCH] getNumberOfPins --- wled00/bus_manager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index c16eca40f..1d1136fd8 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -109,6 +109,7 @@ class Bus { inline bool isOffRefreshRequired(void) const { return _needsRefresh; } inline bool containsPixel(uint16_t pix) const { return pix >= _start && pix < _start + _len; } + static constexpr uint8_t getNumberOfPins(uint8_t type) { return isVirtual(type) ? 4 : isPWM(type) ? numPWMPins(type) : is2Pin(type) + 1; } // credit @PaoloTK static constexpr uint8_t getNumberOfChannels(uint8_t type) { return hasWhite(type) + 3*hasRGB(type) + hasCCT(type); } static constexpr bool hasRGB(uint8_t type) { return !((type >= TYPE_WS2812_1CH && type <= TYPE_WS2812_WWA) || type == TYPE_ANALOG_1CH || type == TYPE_ANALOG_2CH || type == TYPE_ONOFF);