From 90c0870e74eecb896cacf4c7eeaecf13b52f1524 Mon Sep 17 00:00:00 2001 From: Ewoud Date: Sat, 14 Jan 2023 17:30:43 +0100 Subject: [PATCH] pinDropDown: make reserved and read only aware and disable if needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AudioReactive: add disableROPins on WS, SCK, MCLK and SCL 4LD: add disableROPins on CLK settingsum: - addfield: max 49 pins, if (global interface) also disabled, rename if to global, show 🔴 if pin claimed - add disableROPins - pinDropdownsPost - rename SDA to if:SDA (etc) so it is part of claimed pins (also in set.cpp and xml.cpp) xml.cpp: - appendGPIOinfo(): get rsvd and ro_gpio from pinManager.isPinOk instead of hardcoded - getSettingsJS: add pinDropdownsPost --- usermods/audioreactive/audio_reactive.h | 4 + .../usermod_v2_four_line_display_ALT.h | 1 + wled00/data/settings_um.htm | 61 ++- wled00/html_settings.h | 371 +++++++++--------- wled00/set.cpp | 10 +- wled00/xml.cpp | 81 ++-- 6 files changed, 297 insertions(+), 231 deletions(-) diff --git a/usermods/audioreactive/audio_reactive.h b/usermods/audioreactive/audio_reactive.h index 5ccb40d1..4cbfd496 100644 --- a/usermods/audioreactive/audio_reactive.h +++ b/usermods/audioreactive/audio_reactive.h @@ -2105,14 +2105,17 @@ class AudioReactive : public Usermod { oappend(SET_F("xOption('AudioReactive:digitalmic:pin[]',0,' ⎌',")); oappendi(I2S_SDPIN); oappend(");"); #endif oappend(SET_F("addInfo('AudioReactive:digitalmic:pin[]',1,'ws/clk/lrck','I2S WS');")); + oappend(SET_F("disableROPins('AudioReactive:digitalmic:pin[]',1);")); #ifdef I2S_WSPIN oappend(SET_F("xOption('AudioReactive:digitalmic:pin[]',1,' ⎌',")); oappendi(I2S_WSPIN); oappend(");"); #endif oappend(SET_F("addInfo('AudioReactive:digitalmic:pin[]',2,'sck/bclk','I2S SCK');")); + oappend(SET_F("disableROPins('AudioReactive:digitalmic:pin[]',2);")); #ifdef I2S_CKPIN oappend(SET_F("xOption('AudioReactive:digitalmic:pin[]',2,' ⎌',")); oappendi(I2S_CKPIN); oappend(");"); #endif oappend(SET_F("addInfo('AudioReactive:digitalmic:pin[]',3,'master clock','I2S MCLK');")); + oappend(SET_F("disableROPins('AudioReactive:digitalmic:pin[]',3);")); #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) oappend(SET_F("dOptions('AudioReactive:digitalmic:pin[]',3,2,2);")); //only use -1, 0, 1 or 3 oappend(SET_F("dOptions('AudioReactive:digitalmic:pin[]',3,4,39);")); //only use -1, 0, 1 or 3 @@ -2121,6 +2124,7 @@ class AudioReactive : public Usermod { oappend(SET_F("rOption('AudioReactive:digitalmic:pin[]',4,'use global (")); oappendi(i2c_sda); oappend(")',-1);"); oappend(SET_F("addInfo('AudioReactive:digitalmic:pin[]',5,'','I2C SCL');")); oappend(SET_F("rOption('AudioReactive:digitalmic:pin[]',5,'use global (")); oappendi(i2c_scl); oappend(")',-1);"); + oappend(SET_F("disableROPins('AudioReactive:digitalmic:pin[]',5);")); } diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h index 64c9abcc..02a57562 100644 --- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h +++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h @@ -1058,6 +1058,7 @@ class FourLineDisplayUsermod : public Usermod { bool isSPI = (type == SSD1306_SPI || type == SSD1306_SPI64); // WLEDMM add defaults oappend(SET_F("addInfo('4LineDisplay:pin[]',0,'','I2C/SPI CLK');")); + oappend(SET_F("disableROPins('4LineDisplay::pin[]',0);")); #ifdef FLD_PIN_SCL oappend(SET_F("xOption('4LineDisplay:pin[]',0,' ⎌',")); oappendi(FLD_PIN_SCL); oappend(");"); #endif diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm index 1c1b18df..d035f064 100644 --- a/wled00/data/settings_um.htm +++ b/wled00/data/settings_um.htm @@ -122,7 +122,7 @@ if (f.includes("pin")) { var n = this.name.replace("[]","").substr(-3); urows += `