FastLED 3.9.15
Loading...
Searching...
No Matches

◆ allSamePort()

bool fl::DigitalMultiWrite8::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 219 of file pins.cpp.hpp.

219 {
220 int first_port = -1;
221 for (u8 i = 0; i < 8; ++i) {
222 if (mPins[i] < 0) {
223 continue;
224 }
225 int port = fl::pinToPort(mPins[i]);
226 if (first_port < 0) {
227 first_port = port;
228 } else if (port != first_port) {
229 return false;
230 }
231 }
232 return true;
233}
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().

+ Here is the call graph for this function: