FastLED 3.10.8
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 333 of file pins.cpp.hpp.

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

References fl::FL_NO_EXCEPT, mPins, and fl::pinToPort().

Referenced by DigitalMultiWrite16().

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