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

◆ allSamePort()

bool fl::DigitalMultiWrite16::allSamePort ( ) const

Check whether all active pins (non -1) share the same GPIO port.

Returns true if fewer than 2 active pins exist (trivially same port).

Definition at line 332 of file pins.cpp.hpp.

332 {
333 int first_port = -1;
334 for (u8 i = 0; i < 16; ++i) {
335 if (mPins[i] < 0) {
336 continue;
337 }
338 int port = fl::pinToPort(mPins[i]);
339 if (first_port < 0) {
340 first_port = port;
341 } else if (port != first_port) {
342 return false;
343 }
344 }
345 return true;
346}
unsigned char u8
Definition stdint.h:131
int pinToPort(int pin)
Map a runtime pin number to an integer port ID using FastPin<N>::port().
Definition pins.cpp.hpp:150

References mPins, and fl::pinToPort().

Referenced by DigitalMultiWrite16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: