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

◆ CheckPin()

template<uint8_t PIN>
void CheckPin ( )

Definition at line 99 of file Pintest.h.

100{
101 CheckPin<PIN - 1>();
102
103 void *systemThinksPortIs = (void*)portOutputRegister(digitalPinToPort(PIN));
104 RwReg systemThinksMaskIs = digitalPinToBitMask(PIN);
105
106 Serial.print("Pin "); Serial.print(PIN); Serial.print(": Port ");
107
108 if(systemThinksPortIs == (void*)FastPin<PIN>::port()) {
109 Serial.print("valid & mask ");
110 } else {
111 Serial.print("invalid, is "); Serial.print(getPort((void*)FastPin<PIN>::port())); Serial.print(" should be ");
112 Serial.print(getPort((void*)systemThinksPortIs));
113 Serial.print(" & mask ");
114 }
115
116 if(systemThinksMaskIs == FastPin<PIN>::mask()) {
117 Serial.println("valid.");
118 } else {
119 Serial.print("invalid, is "); Serial.print(FastPin<PIN>::mask()); Serial.print(" should be "); Serial.println(systemThinksMaskIs);
120 }
121}
#define PIN
Definition PinMode.ino:7
const char * getPort(void *portRef)
Definition Pintest.h:12
void CheckPin()
Definition Pintest.h:99
static port_t mask()
Get the pin mask.
Definition fastpin.h:345
static port_ptr_t port()
Get the output state of the port.
Definition fastpin.h:343

References CheckPin(), getPort(), FastPin< PIN >::mask(), PIN, and FastPin< PIN >::port().

Referenced by CheckPin(), and loop().

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