 #ifdef PORTL
 	if(portPtr == (void*)&PORTL) { return "PORTL"; }
 #endif
+
+// Teensy 3.x port checks
 #ifdef GPIO_A_PDOR
 	if(portPtr == (void*)&GPIO_A_PDOR) { return "GPIO_A_PDOR"; }
 #endif


	RwReg *systemThinksPortIs = portOutputRegister(digitalPinToPort(PIN));
	RwReg systemThinksMaskIs = digitalPinToBitMask(PIN);
	
	Serial.print("Pin "); Serial.print(PIN); Serial.print(": Port ");
	
	if(systemThinksPortIs == FastPin<PIN>::port()) { 
		Serial.print("valid & mask ");
	} else { 
		Serial.print("invalid, is "); Serial.print(getPort((void*)FastPin<PIN>::port())); Serial.print(" should be "); 
		Serial.print(getPort((void*)systemThinksPortIs));
		Serial.print(" & mask ");
	}

	if(systemThinksMaskIs == FastPin<PIN>::mask()) {
		Serial.println("valid.");
	} else { 
		Serial.print("invalid, is "); Serial.print(FastPin<PIN>::mask()); Serial.print(" should be "); Serial.println(systemThinksMaskIs);
	}
}	

template<> void CheckPin<-1> () {}

void setup() { 
    Serial.begin(38400);
    Serial.println("resetting!");
}

void loop() { 
	CheckPin<MAX_PIN>();
	delay(10000);
}

#ifdef REG_PIO_D_ODSR
	if(portPtr == (void*)&REG_PIO_D_ODSR) { return "REG_PIO_D_ODSR"; }
#endif

// Teensy 4 port checks
#ifdef GPIO1_DR
	if(portPtr == (void*)&GPIO1_DR) { return "GPIO1_DR"; }
#endif
#ifdef GPIO2_DR
if(portPtr == (void*)&GPIO2_DR) { return "GPIO21_DR"; }
#endif
#ifdef GPIO3_DR
if(portPtr == (void*)&GPIO3_DR) { return "GPIO3_DR"; }
#endif
#ifdef GPIO4_DR
if(portPtr == (void*)&GPIO4_DR) { return "GPIO4_DR"; }
#endif
  String unknown_str = "Unknown: " + String((size_t)portPtr, HEX);
	strncpy(fullstrBuffer, unknown_str.c_str(), unknown_str.length());
	fullstrBuffer[sizeof(fullstrBuffer)-1] = '\0';
	return fullstrBuffer;
}

template<uint8_t PIN> void CheckPin()
