15 if(portRef == (
void*)&PORTA) {
return "PORTA"; }
18 if(portRef == (
void*)&PORTB) {
return "PORTB"; }
21 if(portRef == (
void*)&PORTC) {
return "PORTC"; }
24 if(portRef == (
void*)&PORTD) {
return "PORTD"; }
27 if(portRef == (
void*)&PORTE) {
return "PORTE"; }
30 if(portRef == (
void*)&PORTF) {
return "PORTF"; }
33 if(portRef == (
void*)&PORTG) {
return "PORTG"; }
36 if(portRef == (
void*)&PORTH) {
return "PORTH"; }
39 if(portRef == (
void*)&PORTI) {
return "PORTI"; }
42 if(portRef == (
void*)&PORTJ) {
return "PORTJ"; }
45 if(portRef == (
void*)&PORTK) {
return "PORTK"; }
48 if(portRef == (
void*)&PORTL) {
return "PORTL"; }
53 if(portRef == (
void*)&GPIO_A_PDOR) {
return "GPIO_A_PDOR"; }
56 if(portRef == (
void*)&GPIO_B_PDOR) {
return "GPIO_B_PDOR"; }
59 if(portRef == (
void*)&GPIO_C_PDOR) {
return "GPIO_C_PDOR"; }
62 if(portRef == (
void*)&GPIO_D_PDOR) {
return "GPIO_D_PDOR"; }
65 if(portRef == (
void*)&GPIO_E_PDOR) {
return "GPIO_E_PDOR"; }
68 if(portRef == (
void*)®_PIO_A_ODSR) {
return "REG_PIO_A_ODSR"; }
71 if(portRef == (
void*)®_PIO_B_ODSR) {
return "REG_PIO_B_ODSR"; }
74 if(portRef == (
void*)®_PIO_C_ODSR) {
return "REG_PIO_C_ODSR"; }
77 if(portRef == (
void*)®_PIO_D_ODSR) {
return "REG_PIO_D_ODSR"; }
82 if(portRef == (
void*)&GPIO1_DR) {
return "GPIO1_DR"; }
85if(portRef == (
void*)&GPIO2_DR) {
return "GPIO21_DR"; }
88if(portRef == (
void*)&GPIO3_DR) {
return "GPIO3_DR"; }
91if(portRef == (
void*)&GPIO4_DR) {
return "GPIO4_DR"; }
93 String unknown_str =
"Unknown: " + String((
size_t)portRef, HEX);
94 strncpy(
fullstrBuffer, unknown_str.c_str(), unknown_str.length());
103 void *systemThinksPortIs = (
void*)portOutputRegister(digitalPinToPort(
PIN));
104 RwReg systemThinksMaskIs = digitalPinToBitMask(
PIN);
106 Serial.print(
"Pin "); Serial.print(
PIN); Serial.print(
": Port ");
109 Serial.print(
"valid & mask ");
112 Serial.print(
getPort((
void*)systemThinksPortIs));
113 Serial.print(
" & mask ");
117 Serial.println(
"valid.");
119 Serial.print(
"invalid, is "); Serial.print(
FastPin<PIN>::mask()); Serial.print(
" should be "); Serial.println(systemThinksMaskIs);
153 RwReg *systemThinksPortIs = portOutputRegister(digitalPinToPort(
PIN));
154 RwReg systemThinksMaskIs = digitalPinToBitMask(
PIN);
157 while(systemThinksMaskIs > 1) { systemThinksMaskIs >>= 1; maskBit++; }
159 const char *pinport =
GetPinPort((
void*)systemThinksPortIs);
161 Serial.print(
"__FL_DEFPIN("); Serial.print(
PIN);
162 Serial.print(
","); Serial.print(maskBit);
163 Serial.print(
","); Serial.print(pinport);
173 RwReg *systemThinksPortIs = portOutputRegister(digitalPinToPort(0));
174 RwReg systemThinksMaskIs = digitalPinToBitMask(0);
177 while(systemThinksMaskIs > 1) { systemThinksMaskIs >>= 1; maskBit++; }
179 const char *pinport =
GetPinPort((
void*)systemThinksPortIs);
181 Serial.print(
"__FL_DEFPIN("); Serial.print(0);
182 Serial.print(
","); Serial.print(maskBit);
183 Serial.print(
","); Serial.print(pinport);
194 Serial.println(
"resetting!");
204 Serial.println(
"-----");
205#ifdef NUM_DIGITAL_PINS
208 Serial.println(
"------");
central include file for FastLED, defines the CFastLED class/object
const char * GetPinPort(void *ptr)
const char * getPort(void *portRef)
const char * _GetPinPort< 0 >(void *ptr)
const char * _GetPinPort(void *ptr)
static port_t mask()
Get the pin mask.
static port_ptr_t port()
Get the output state of the port.
static const void * portAddr()
Gets the raw address of the port.
static bool hasPort()
Checks whether a port exists.
static const char * portName()
Gets the name of the port, as a C-string.