structure PinIndex

This commit is contained in:
Marcus 2024-10-23 19:03:50 +02:00
parent 0227427b6f
commit 13087c0cc1
4 changed files with 18 additions and 15 deletions

View file

@ -131,6 +131,10 @@ void setup() {
LoadConfig(); LoadConfig();
Wifi_Init(); Wifi_Init();
Webserver_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);
}
} }

View file

@ -105,20 +105,19 @@ Config config;
/* actual structure initialization for Pin_Index is done within the header files /* actual structure initialization for Pin_Index is done within the header files
* for ESP32 and ESP8266 * for ESP32 and ESP8266
* *
* notes explenation: * Pin_Index.note explenation:
* - BF_L: BootFails when LOW * 1 - BF_L: BootFails when LOW
* - BF_H: BootFails when HIGH * 2 - BF_H: BootFails when HIGH
* - FM_L: FlashMode needs LOW to enter * 3 - FM_L: FlashMode needs LOW to enter
* - IN_O: Input Only * 4 - IN_O: Input Only
*/ */
const char* BF_L = "BF_L"; const byte BF_L = 1;
const char* BF_H = "BF_H"; const byte BF_H = 2;
const char* FM_L = "FM_L"; const byte FM_L = 3;
const char* IN_O = "IN_O"; const byte IN_O = 4;
struct Pin_Index { struct Pin_Index {
const byte gpio; const byte gpio;
const char* notes[8]; const byte note;
char* usedBy[8];
}; };

View file

@ -61,9 +61,9 @@
// //
const byte pinIndex_length = 21; const byte PinIndex_length = 21;
// initialize pinIndex with all usable GPIOs // initialize pinIndex with all usable GPIOs
Pin_Index pinIndex[] = { { 0, FM_L }, Pin_Index PinIndex[] = { { 0, FM_L },
{ 4 }, { 4 },
{ 5 }, { 5 },
{ 12, BF_H }, { 12, BF_H },

View file

@ -45,9 +45,9 @@
* - GPIO 16 / D0 * - GPIO 16 / D0
*/ */
const byte pinIndex_length = 6; const byte PinIndex_length = 6;
// initialize pinIndex with all usable GPIOs // initialize pinIndex with all usable GPIOs
Pin_Index pinIndex[] = { { 0, BF_L }, Pin_Index PinIndex[] = { { 0, BF_L },
{ 12 }, { 12 },
{ 13 }, { 13 },
{ 14 }, { 14 },