Skip to content

Commit

Permalink
getNumberOfPins
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed Aug 25, 2024
1 parent f55e2fc commit 865e3dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wled00/bus_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 865e3dc

Please sign in to comment.