diff --git a/usermods/audioreactive/audio_reactive.h b/usermods/audioreactive/audio_reactive.h index 49f6e850f0..3a00032319 100644 --- a/usermods/audioreactive/audio_reactive.h +++ b/usermods/audioreactive/audio_reactive.h @@ -1743,12 +1743,6 @@ class AudioReactive : public Usermod { audioSource = new WM8978Source(SAMPLE_RATE, BLOCK_SIZE, 1.0f); //useInputFilter = 0; // to disable low-cut software filtering and restore previous behaviour delay(100); - // WLEDMM align global pins - if ((sdaPin >= 0) && (i2c_sda < 0)) i2c_sda = sdaPin; // copy usermod prefs into globals (if globals not defined) - if ((sclPin >= 0) && (i2c_scl < 0)) i2c_scl = sclPin; - if (i2c_sda >= 0) sdaPin = -1; // -1 = use global - if (i2c_scl >= 0) sclPin = -1; - if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin); break; @@ -2469,6 +2463,8 @@ class AudioReactive : public Usermod { configComplete &= getJsonValue(top[FPSTR(_digitalmic)]["pin"][1], i2swsPin); configComplete &= getJsonValue(top[FPSTR(_digitalmic)]["pin"][2], i2sckPin); configComplete &= getJsonValue(top[FPSTR(_digitalmic)]["pin"][3], mclkPin); + configComplete &= getJsonValue(top[FPSTR(_digitalmic)]["pin"][4], i2c_sda); + configComplete &= getJsonValue(top[FPSTR(_digitalmic)]["pin"][5], i2c_scl); configComplete &= getJsonValue(top["config"][F("squelch")], soundSquelch); configComplete &= getJsonValue(top["config"][F("gain")], sampleGain); @@ -2694,9 +2690,14 @@ class AudioReactive : public Usermod { oappend(SET_F("xOpt('AudioReactive:digitalmic:pin[]',3,' ⎌',")); oappendi(MCLK_PIN); oappend(");"); #endif - oappend(SET_F("dRO('AudioReactive:digitalmic:pin[]',5);")); // disable read only pins + oappend(SET_F("addInfo('AudioReactive:digitalmic:pin[]',4,'','I2C SDA');")); + oappend(SET_F("rOpt('AudioReactive:digitalmic:pin[]',4,'using global (")); oappendi(i2c_sda); oappend(")',-1);"); oappend(SET_F("disableElement('AudioReactive:digitalmic:pin[]',4);")); + + oappend(SET_F("addInfo('AudioReactive:digitalmic:pin[]',5,'','I2C SCL');")); + oappend(SET_F("rOpt('AudioReactive:digitalmic:pin[]',5,'using global (")); oappendi(i2c_scl); oappend(")',-1);"); oappend(SET_F("disableElement('AudioReactive:digitalmic:pin[]',5);")); + #endif }