From df6435f6e1e9c9af5dfd49990ebcf6879d78b208 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sun, 17 Nov 2024 06:54:13 +0100 Subject: [PATCH] add gpio pin or i2c address to output/sensor table if used --- Arduino/CanGrow/CanGrow.ino | 2 +- Arduino/CanGrow/include/CanGrow_ESP32.h | 3 +- Arduino/CanGrow/include/CanGrow_ESP8266.h | 3 +- Arduino/CanGrow/include/Webserver/Common.h | 2 +- .../CanGrow/include/Webserver/Page_system.h | 34 +++++++++++++++++++ .../include/Webserver/Page_system_HTML.h | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index 11f015e..33430da 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -134,7 +134,7 @@ void setup() { Wifi_Init(); Webserver_Init(); Serial.printf(":: [SETUP] Usable Pins: %d\n", GPIOindex_length); - for(byte i = 0; i < GPIOindex_length; i++) { + for(byte i = 1; i <= GPIOindex_length; i++) { Serial.printf(":: [SETUP] Pin Index: %d, GPIO: %d, Notes: ", i, GPIOindex[i].gpio); Serial.println(GPIO_Index_note_descr[GPIOindex[i].note]); } diff --git a/Arduino/CanGrow/include/CanGrow_ESP32.h b/Arduino/CanGrow/include/CanGrow_ESP32.h index c1bd1c2..2acadf4 100644 --- a/Arduino/CanGrow/include/CanGrow_ESP32.h +++ b/Arduino/CanGrow/include/CanGrow_ESP32.h @@ -63,7 +63,8 @@ // const byte GPIOindex_length = 21; // initialize pinIndex with all usable GPIOs -GPIO_Index GPIOindex[] = { { 0, FLASHMODE_LOW }, +GPIO_Index GPIOindex[] = {{ 255, 255 }, + { 0, FLASHMODE_LOW }, { 4 }, { 5 }, { 12, BOOTFAILS_HIGH }, diff --git a/Arduino/CanGrow/include/CanGrow_ESP8266.h b/Arduino/CanGrow/include/CanGrow_ESP8266.h index 98eefa2..446d0d9 100644 --- a/Arduino/CanGrow/include/CanGrow_ESP8266.h +++ b/Arduino/CanGrow/include/CanGrow_ESP8266.h @@ -47,7 +47,8 @@ const byte GPIOindex_length = 6; // initialize pinIndex with all usable GPIOs -GPIO_Index GPIOindex[] = { { 0, BOOTFAILS_LOW }, +GPIO_Index GPIOindex[] = {{ 255, 255 }, + { 0, BOOTFAILS_LOW }, { 12 }, { 13 }, { 14 }, diff --git a/Arduino/CanGrow/include/Webserver/Common.h b/Arduino/CanGrow/include/Webserver/Common.h index 7cc00cd..0ba05fa 100644 --- a/Arduino/CanGrow/include/Webserver/Common.h +++ b/Arduino/CanGrow/include/Webserver/Common.h @@ -118,7 +118,7 @@ String Html_SelectOpt_GPIOindex(byte selectId = 255) { String gpioIndex_html; // iterate through through all available GPIOs in index - for(byte i = 0; i < GPIOindex_length; i++) { + for(byte i = 1; i <= GPIOindex_length; i++) { bool gpioUsed = Check_GPIOindex_Used(i); gpioIndex_html += "