diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index a737ebe..456fb60 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -131,6 +131,10 @@ void setup() { LoadConfig(); Wifi_Init(); Webserver_Init(); + Serial.printf("Usable Pins: %d\n", PinIndex_length); + for(byte i = 0; i < PinIndex_length; i++) { + Serial.printf("Pin Index: %d, GPIO: %d, Notes: %d\n", i, PinIndex[i].gpio, PinIndex[i].note); + } } diff --git a/Arduino/CanGrow/include/CanGrow.h b/Arduino/CanGrow/include/CanGrow.h index 87d313f..3fa3018 100644 --- a/Arduino/CanGrow/include/CanGrow.h +++ b/Arduino/CanGrow/include/CanGrow.h @@ -105,20 +105,19 @@ Config config; /* actual structure initialization for Pin_Index is done within the header files * for ESP32 and ESP8266 * - * notes explenation: - * - BF_L: BootFails when LOW - * - BF_H: BootFails when HIGH - * - FM_L: FlashMode needs LOW to enter - * - IN_O: Input Only + * Pin_Index.note explenation: + * 1 - BF_L: BootFails when LOW + * 2 - BF_H: BootFails when HIGH + * 3 - FM_L: FlashMode needs LOW to enter + * 4 - IN_O: Input Only */ -const char* BF_L = "BF_L"; -const char* BF_H = "BF_H"; -const char* FM_L = "FM_L"; -const char* IN_O = "IN_O"; +const byte BF_L = 1; +const byte BF_H = 2; +const byte FM_L = 3; +const byte IN_O = 4; struct Pin_Index { const byte gpio; - const char* notes[8]; - char* usedBy[8]; + const byte note; }; diff --git a/Arduino/CanGrow/include/CanGrow_ESP32.h b/Arduino/CanGrow/include/CanGrow_ESP32.h index 4e3ea05..0a63606 100644 --- a/Arduino/CanGrow/include/CanGrow_ESP32.h +++ b/Arduino/CanGrow/include/CanGrow_ESP32.h @@ -61,9 +61,9 @@ // -const byte pinIndex_length = 21; +const byte PinIndex_length = 21; // initialize pinIndex with all usable GPIOs -Pin_Index pinIndex[] = { { 0, FM_L }, +Pin_Index PinIndex[] = { { 0, FM_L }, { 4 }, { 5 }, { 12, BF_H }, diff --git a/Arduino/CanGrow/include/CanGrow_ESP8266.h b/Arduino/CanGrow/include/CanGrow_ESP8266.h index 0921818..b3215fb 100644 --- a/Arduino/CanGrow/include/CanGrow_ESP8266.h +++ b/Arduino/CanGrow/include/CanGrow_ESP8266.h @@ -45,9 +45,9 @@ * - GPIO 16 / D0 */ -const byte pinIndex_length = 6; +const byte PinIndex_length = 6; // initialize pinIndex with all usable GPIOs -Pin_Index pinIndex[] = { { 0, BF_L }, +Pin_Index PinIndex[] = { { 0, BF_L }, { 12 }, { 13 }, { 14 },