diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/usermod_temperature.h index a666639f..95026ca8 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/usermod_temperature.h @@ -164,7 +164,7 @@ class UsermodTemperature : public Usermod { temperature = -127.0f; // default to -127, DS18B20 only goes down to -50C if (enabled) { // config says we are enabled - DEBUG_PRINTLN(F("Allocating temperature pin...")); + USER_PRINTLN(F("Finding temperature pin...")); // pin retrieved from cfg.json (readFromConfig()) prior to running setup() if (temperaturePin >= 0 && pinManager.allocatePin(temperaturePin, true, PinOwner::UM_Temperature)) { oneWire = new OneWire(temperaturePin); @@ -175,13 +175,14 @@ class UsermodTemperature : public Usermod { } } else { if (temperaturePin >= 0) { - DEBUG_PRINTLN(F("Temperature pin allocation failed.")); + USER_PRINTLN(F("Temperature pin allocation failed.")); } temperaturePin = -1; // allocation failed } } lastMeasurement = millis() - readingInterval + 10000; initDone = true; + USER_PRINTLN(F("temperature usermod initialized.")); } void loop() { diff --git a/usermods/audioreactive/audio_reactive.h b/usermods/audioreactive/audio_reactive.h index 5cce050f..0a0c1d05 100644 --- a/usermods/audioreactive/audio_reactive.h +++ b/usermods/audioreactive/audio_reactive.h @@ -1302,9 +1302,11 @@ class AudioReactive : public Usermod { #ifdef WLED_DEBUG DEBUG_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings.")); #else - ERRORSR_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings.")); + USER_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings.")); #endif disableSoundProcessing = true; + } else { + USER_PRINTLN(F("AR: sound input driver initialized successfully.")); } if (enabled) connectUDPSoundSync(); diff --git a/usermods/usermod_v2_four_line_display/usermod_v2_four_line_display.h b/usermods/usermod_v2_four_line_display/usermod_v2_four_line_display.h index ac65508b..c3e9667f 100644 --- a/usermods/usermod_v2_four_line_display/usermod_v2_four_line_display.h +++ b/usermods/usermod_v2_four_line_display/usermod_v2_four_line_display.h @@ -177,9 +177,9 @@ class FourLineDisplayUsermod : public Usermod { isHW = (ioPin[0]==i2c_scl && ioPin[1]==i2c_sda); //isHW = true; if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins - if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid + if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; enabled = false; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid PinManagerPinType pins[2] = { { ioPin[0], true }, { ioPin[1], true } }; - if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; } + if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; enabled = false; return; } } DEBUG_PRINTLN(F("Allocating display.")); @@ -224,14 +224,14 @@ class FourLineDisplayUsermod : public Usermod { } if (nullptr == u8x8) { - DEBUG_PRINTLN(F("Display init failed.")); + USER_PRINTLN(F("Display init failed.")); pinManager.deallocateMultiplePins((const uint8_t*)ioPin, (type == SSD1306_SPI || type == SSD1306_SPI64) ? 5 : 2, po); type = NONE; return; } initDone = true; - DEBUG_PRINTLN(F("Starting display.")); + USER_PRINTLN(F("Starting display.")); /*if (!(type == SSD1306_SPI || type == SSD1306_SPI64))*/ u8x8->setBusClock(ioFrequency); // can be used for SPI too u8x8->begin(); setFlipMode(flip); 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 79fef942..9474faab 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 @@ -339,8 +339,8 @@ class FourLineDisplayUsermod : public Usermod { // isHW = true; if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins PinManagerPinType pins[2] = { {ioPin[0], true }, { ioPin[1], true } }; - if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid - if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; } + if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; enabled=false; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid + if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; enabled=false; return; } } DEBUG_PRINTLN(F("Allocating display.")); @@ -418,14 +418,14 @@ class FourLineDisplayUsermod : public Usermod { } if (nullptr == u8x8) { - DEBUG_PRINTLN(F("Display init failed.")); + USER_PRINTLN(F("Display init failed.")); pinManager.deallocateMultiplePins((const uint8_t*)ioPin, isSPI ? 5 : 2, po); type = NONE; return; } lineHeight = u8x8->getRows() > 4 ? 2 : 1; - DEBUG_PRINTLN(F("Starting display.")); + USER_PRINTLN(F("Starting display.")); u8x8->setBusClock(ioFrequency); // can be used for SPI too u8x8->begin(); setFlipMode(flip); diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index ab975711..fbee0fdb 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -369,6 +369,7 @@ void clearEEPROM(); //wled_serial.cpp void handleSerial(); void updateBaudRate(uint32_t rate); +bool canUseSerial(void); // WLEDMM returns true if Serial can be used for debug output (i.e. not configured for other purpose) //wled_server.cpp bool isIp(String str); diff --git a/wled00/pin_manager.cpp b/wled00/pin_manager.cpp index 7dc69d0f..00dbfa4d 100644 --- a/wled00/pin_manager.cpp +++ b/wled00/pin_manager.cpp @@ -300,6 +300,8 @@ bool PinManagerClass::allocateMultiplePins(const managed_pin_type * mptArray, by DEBUG_PRINT(gpio); DEBUG_PRINT(" as "); DEBUG_PRINT(mptArray[i].isOutput ? "output": "input"); // WLEDMM DEBUG_PRINTLN(F("")); + #else // WLEDMM + USER_PRINTF("PIN ALLOC: cannot use GPIO%d for %s.\n", gpio, mptArray[i].isOutput ? "output": "input"); #endif if ((gpio < WLED_NUM_PINS) && (gpio >= 0) && (tag != PinOwner::None)) { ownerConflict[gpio] = tag; // WLEDMM record conflict @@ -317,6 +319,8 @@ bool PinManagerClass::allocateMultiplePins(const managed_pin_type * mptArray, by DEBUG_PRINT(F(" already allocated by ")); DebugPrintOwnerTag(ownerTag[gpio]); DEBUG_PRINTLN(F("")); + #else // WLEDMM + USER_PRINTF("PIN ALLOC: failed to assign GPIO%d to %s.\n", gpio, getOwnerText(tag).c_str()); #endif shouldFail = true; } @@ -375,6 +379,10 @@ bool PinManagerClass::allocatePin(byte gpio, bool output, PinOwner tag) DEBUG_PRINTLN(F(" - HW I2C & SPI pins have to be allocated using allocateMultiplePins()")); } } + #else // WLEDMM + if (gpio < 255) { + USER_PRINTF("PIN ALLOC: cannot use GPIO%d for %s.\n", gpio, output ? "output": "input"); + } #endif return false; } @@ -386,6 +394,8 @@ bool PinManagerClass::allocatePin(byte gpio, bool output, PinOwner tag) DEBUG_PRINT(F(" already allocated by ")); DebugPrintOwnerTag(ownerTag[gpio]); DEBUG_PRINTLN(F("")); + #else // WLEDMM + USER_PRINTF("PIN ALLOC: failed to assign GPIO%d to %s.\n", gpio, getOwnerText(tag).c_str()); #endif return false; } diff --git a/wled00/set.cpp b/wled00/set.cpp index 8d44efec..966e8d76 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -171,7 +171,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) #ifdef ESP32 if (((buttonType[i] == BTN_TYPE_ANALOG) || (buttonType[i] == BTN_TYPE_ANALOG_INVERTED)) && (digitalPinToAnalogChannel(btnPin[i]) < 0)) { // WLEDMM // not an ADC analog pin - DEBUG_PRINTF("PIN ALLOC error: GPIO%d for analog button #%d is not an analog pin!\n", btnPin[i], i); + USER_PRINTF("PIN ALLOC error: GPIO%d for analog button #%d is not an analog pin!\n", btnPin[i], i); btnPin[i] = -1; pinManager.deallocatePin(hw_btn_pin,PinOwner::Button); } else { // WLEDMM end diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 9ebc4fd3..0a836b79 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -279,12 +279,16 @@ void WLED::setup() #if defined(WLED_DEBUG) && (defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)) delay(2500); // allow CDC USB serial to initialise #endif - DEBUG_PRINTLN(); - DEBUG_PRINT(F("---WLED ")); - DEBUG_PRINT(versionString); - DEBUG_PRINT(" "); - DEBUG_PRINT(VERSION); - DEBUG_PRINTLN(F(" INIT---")); + USER_PRINTLN(); + USER_PRINT(F("---WLED ")); + USER_PRINT(versionString); + USER_PRINT(" "); + USER_PRINT(VERSION); + USER_PRINTLN(F(" INIT---")); + #ifdef WLED_RELEASE_NAME + USER_PRINTF("WLEDMM_%s %s\n", versionString, releaseString); // WLEDMM specific + #endif + #ifdef ARDUINO_ARCH_ESP32 DEBUG_PRINT(F("esp32 ")); DEBUG_PRINTLN(ESP.getSdkVersion()); @@ -354,20 +358,21 @@ void WLED::setup() pinManager.allocatePin(2, true, PinOwner::DMX); #endif + USER_PRINTLN(); DEBUG_PRINTLN(F("Registering usermods ...")); registerUsermods(); for (uint8_t i=1; i 0) return false; // don't interfere when IMPROV communication is ongoing + if (continuousSendLED == true) return false; // Continuous Serial Streaming + + return true; +} // WLEDMM end + void handleSerial() { if (pinManager.isPinAllocated(hardwareRX)) return;