From 191bbf93f3fcc510e332fd922ef3ec88d0b1217a Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Tue, 6 Dec 2022 16:07:12 +0100 Subject: [PATCH] post-merge changes reconciling disagreements between MM and AC source code --- wled00/FX.cpp | 2 +- wled00/pin_manager.cpp | 2 +- wled00/pin_manager.h | 2 +- wled00/set.cpp | 5 ++++- wled00/wled_server.cpp | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 9527aeb3..ab8dcc28 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -6128,7 +6128,7 @@ uint16_t mode_2DWaverly(void) { long t = millis() / 2; for (int i = 0; i < cols; i++) { - uint16_t thisVal = volumeSmth*SEGMENT.intensity/64 * inoise8(i * 45 , t , t)/64; + uint16_t thisVal = volumeSmth*SEGMENT.intensity/64 * inoise8(i * 45 , t , t)/64; // WLEDMM back to SR code uint16_t thisMax = map(thisVal, 0, 512, 0, rows); for (int j = 0; j < thisMax; j++) { diff --git a/wled00/pin_manager.cpp b/wled00/pin_manager.cpp index c32bd202..25fe97d0 100644 --- a/wled00/pin_manager.cpp +++ b/wled00/pin_manager.cpp @@ -58,6 +58,7 @@ String PinManagerClass::getOwnerText(PinOwner tag) { case PinOwner::UM_BME280 : return(F("BME280 (UM)")); break; // "usermod_bme280.h" -- Uses "standard" HW_I2C pins case PinOwner::UM_BH1750 : return(F("BH1750 (UM)")); break; // "usermod_bh1750.h" -- Uses "standard" HW_I2C pins case PinOwner::UM_SdCard : return(F("SD-Card (UM)")); break; // "usermod_sd_card.h" -- Uses SPI pins + case PinOwner::UM_PWM_OUTPUTS : return(F("PWM Output (UM)")); break; // "usermod_pwm_outputs.h" case PinOwner::UM_Example : return(F("example (UM)")); break; // unspecified usermod case PinOwner::UM_Unspecified : return(F("usermod (UM)")); break; // unspecified usermod @@ -497,7 +498,6 @@ bool PinManagerClass::isPinOk(byte gpio, bool output) PinOwner PinManagerClass::getPinOwner(byte gpio) { if (gpio >= WLED_NUM_PINS) return PinOwner::None; // catch error case, to avoid array out-of-bounds access if (!isPinOk(gpio, false)) return PinOwner::None; - if (gpio >= WLED_NUM_PINS) return PinOwner::None; // WLEDMM: catch error cases return ownerTag[gpio]; } diff --git a/wled00/pin_manager.h b/wled00/pin_manager.h index 919e6403..3e6db783 100644 --- a/wled00/pin_manager.h +++ b/wled00/pin_manager.h @@ -74,7 +74,7 @@ class PinManagerClass { #define WLED_NUM_PINS 50 uint8_t pinAlloc[7] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; //WLEDMM bugfix - 56bit, 1 bit per pin, we use 50 bits on -S3 uint8_t ledcAlloc[2] = {0x00, 0x00}; //16 LEDC channels - PinOwner ownerTag[WLED_NUM_PINS] = { PinOwner::None }; // WLEDMM bugfix - new MCU's have up to 50 GPIO + PinOwner ownerTag[WLED_NUM_PINS] = { PinOwner::None }; // new MCU's have up to 50 GPIO PinOwner ownerConflict[WLED_NUM_PINS] = { PinOwner::None }; // WLEDMM: record pin alloc conflicts #endif struct { diff --git a/wled00/set.cpp b/wled00/set.cpp index ab3c91bd..593aeea9 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -176,8 +176,11 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) btnPin[i] = -1; pinManager.deallocatePin(hw_btn_pin,PinOwner::Button); } else { // WLEDMM end + if (disablePullUp) { + pinMode(btnPin[i], INPUT); + } else { pinMode(btnPin[i], buttonType[i]==BTN_TYPE_PUSH_ACT_HIGH ? INPUT_PULLDOWN : INPUT_PULLUP); - } + } } #else pinMode(btnPin[i], INPUT_PULLUP); #endif diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index 16b93374..28e9f2e6 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -45,7 +45,7 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t request->_tempFile = WLED_FS.open(finalname, "w"); DEBUG_PRINT(F("Uploading ")); DEBUG_PRINTLN(finalname); - if (finalname.equals("/presets.json")) presetsModifiedTime = toki.second(); // WLEDMM + if (finalname.equals("/presets.json")) presetsModifiedTime = toki.second(); } if (len) { request->_tempFile.write(data,len);