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();
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);
}
}

View file

@ -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;
};

View file

@ -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 },

View file

@ -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 },