FastLED 3.9.15
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 338 of file pins.cpp.hpp.

338 {
339 int first_port = -1;
340 for (u8 i = 0; i < 16; ++i) {
341 if (mPins[i] < 0) {
342 continue;
343 }
344 int port = fl::pinToPort(mPins[i]);
345 if (first_port < 0) {
346 first_port = port;
347 } else if (port != first_port) {
348 return false;
349 }
350 }
351 return true;
352}
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: