12 if(portRef == (
void*)&PORTA) {
return "PORTA"; }
15 if(portRef == (
void*)&PORTB) {
return "PORTB"; }
18 if(portRef == (
void*)&PORTC) {
return "PORTC"; }
21 if(portRef == (
void*)&PORTD) {
return "PORTD"; }
24 if(portRef == (
void*)&PORTE) {
return "PORTE"; }
27 if(portRef == (
void*)&PORTF) {
return "PORTF"; }
30 if(portRef == (
void*)&PORTG) {
return "PORTG"; }
33 if(portRef == (
void*)&PORTH) {
return "PORTH"; }
36 if(portRef == (
void*)&PORTI) {
return "PORTI"; }
39 if(portRef == (
void*)&PORTJ) {
return "PORTJ"; }
42 if(portRef == (
void*)&PORTK) {
return "PORTK"; }
45 if(portRef == (
void*)&PORTL) {
return "PORTL"; }
50 if(portRef == (
void*)&GPIO_A_PDOR) {
return "GPIO_A_PDOR"; }
53 if(portRef == (
void*)&GPIO_B_PDOR) {
return "GPIO_B_PDOR"; }
56 if(portRef == (
void*)&GPIO_C_PDOR) {
return "GPIO_C_PDOR"; }
59 if(portRef == (
void*)&GPIO_D_PDOR) {
return "GPIO_D_PDOR"; }
62 if(portRef == (
void*)&GPIO_E_PDOR) {
return "GPIO_E_PDOR"; }
65 if(portRef == (
void*)®_PIO_A_ODSR) {
return "REG_PIO_A_ODSR"; }
68 if(portRef == (
void*)®_PIO_B_ODSR) {
return "REG_PIO_B_ODSR"; }
71 if(portRef == (
void*)®_PIO_C_ODSR) {
return "REG_PIO_C_ODSR"; }
74 if(portRef == (
void*)®_PIO_D_ODSR) {
return "REG_PIO_D_ODSR"; }
79 if(portRef == (
void*)&GPIO1_DR) {
return "GPIO1_DR"; }
82if(portRef == (
void*)&GPIO2_DR) {
return "GPIO21_DR"; }
85if(portRef == (
void*)&GPIO3_DR) {
return "GPIO3_DR"; }
88if(portRef == (
void*)&GPIO4_DR) {
return "GPIO4_DR"; }
90 String unknown_str =
"Unknown: " + String((
size_t)portRef, HEX);
91 strncpy(
fullstrBuffer, unknown_str.c_str(), unknown_str.length());
100 void *systemThinksPortIs = (
void*)portOutputRegister(digitalPinToPort(
PIN));
101 RwReg systemThinksMaskIs = digitalPinToBitMask(
PIN);
103 Serial.print(
"Pin "); Serial.print(
PIN); Serial.print(
": Port ");
106 Serial.print(
"valid & mask ");
109 Serial.print(
getPort((
void*)systemThinksPortIs));
110 Serial.print(
" & mask ");
114 Serial.println(
"valid.");
116 Serial.print(
"invalid, is "); Serial.print(
FastPin<PIN>::mask()); Serial.print(
" should be "); Serial.println(systemThinksMaskIs);
144 RwReg *systemThinksPortIs = portOutputRegister(digitalPinToPort(
PIN));
145 RwReg systemThinksMaskIs = digitalPinToBitMask(
PIN);
148 while(systemThinksMaskIs > 1) { systemThinksMaskIs >>= 1; maskBit++; }
150 const char *pinport =
GetPinPort((
void*)systemThinksPortIs);
152 Serial.print(
"__FL_DEFPIN("); Serial.print(
PIN);
153 Serial.print(
","); Serial.print(maskBit);
154 Serial.print(
","); Serial.print(pinport);
164 RwReg *systemThinksPortIs = portOutputRegister(digitalPinToPort(0));
165 RwReg systemThinksMaskIs = digitalPinToBitMask(0);
168 while(systemThinksMaskIs > 1) { systemThinksMaskIs >>= 1; maskBit++; }
170 const char *pinport =
GetPinPort((
void*)systemThinksPortIs);
172 Serial.print(
"__FL_DEFPIN("); Serial.print(0);
173 Serial.print(
","); Serial.print(maskBit);
174 Serial.print(
","); Serial.print(pinport);
185 Serial.println(
"resetting!");
195 Serial.println(
"-----");
196#ifdef NUM_DIGITAL_PINS
199 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(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.