diff --git a/wled00/const.h b/wled00/const.h index 322c32b99..429d45666 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -279,11 +279,15 @@ #endif #ifndef MAX_LED_MEMORY -#ifdef ESP8266 -#define MAX_LED_MEMORY 4000 -#else -#define MAX_LED_MEMORY 64000 -#endif + #ifdef ESP8266 + #define MAX_LED_MEMORY 4000 + #else + #ifdef ARDUINO_ARCH_ESP32S2 + #define MAX_LED_MEMORY 32000 + #else + #define MAX_LED_MEMORY 64000 + #endif + #endif #endif #ifndef MAX_LEDS_PER_BUS @@ -333,7 +337,8 @@ #define JSON_BUFFER_SIZE 24576 #endif -#define MIN_HEAP_SIZE (MAX_LED_MEMORY+2048) +//#define MIN_HEAP_SIZE (MAX_LED_MEMORY+2048) +#define MIN_HEAP_SIZE (8192) // Maximum size of node map (list of other WLED instances) #ifdef ESP8266 diff --git a/wled00/ir.cpp b/wled00/ir.cpp index 35464cac6..e55cec781 100644 --- a/wled00/ir.cpp +++ b/wled00/ir.cpp @@ -728,7 +728,7 @@ void handleIR() { if (results.value != 0) // only print results if anything is received ( != 0 ) { - if (!pinManager.isPinAllocated(1) || pinManager.getPinOwner(1) == PinOwner::DebugOut) //GPIO 1 - Serial TX pin + if (!pinManager.isPinAllocated(TX) || pinManager.getPinOwner(TX) == PinOwner::DebugOut) //GPIO 1 - Serial TX pin Serial.printf_P(PSTR("IR recv: 0x%lX\n"), (unsigned long)results.value); } decodeIR(results.value); diff --git a/wled00/wled.cpp b/wled00/wled.cpp index c9f590fb3..882c49b8e 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -293,7 +293,7 @@ void WLED::setup() //DEBUG_PRINTLN(heapPreAlloc - ESP.getFreeHeap()); #ifdef WLED_DEBUG - pinManager.allocatePin(1, true, PinOwner::DebugOut); // GPIO1 reserved for debug output + pinManager.allocatePin(TX, true, PinOwner::DebugOut); // GPIO1 reserved for debug output #endif #ifdef WLED_ENABLE_DMX //reserve GPIO2 as hardcoded DMX pin pinManager.allocatePin(2, true, PinOwner::DMX); @@ -348,7 +348,7 @@ void WLED::setup() #ifdef WLED_ENABLE_ADALIGHT //Serial RX (Adalight, Improv, Serial JSON) only possible if GPIO3 unused //Serial TX (Debug, Improv, Serial JSON) only possible if GPIO1 unused - if (!pinManager.isPinAllocated(3) && !pinManager.isPinAllocated(1)) { + if (!pinManager.isPinAllocated(RX) && !pinManager.isPinAllocated(TX)) { Serial.println(F("Ada")); } #endif diff --git a/wled00/wled_serial.cpp b/wled00/wled_serial.cpp index a73127e04..989e670ad 100644 --- a/wled00/wled_serial.cpp +++ b/wled00/wled_serial.cpp @@ -26,7 +26,7 @@ void updateBaudRate(uint32_t rate){ if (rate100 == currentBaud || rate100 < 96) return; currentBaud = rate100; - if (!pinManager.isPinAllocated(1) || pinManager.getPinOwner(1) == PinOwner::DebugOut){ + if (!pinManager.isPinAllocated(TX) || pinManager.getPinOwner(1) == PinOwner::DebugOut){ Serial.print(F("Baud is now ")); Serial.println(rate); } @@ -36,7 +36,7 @@ void updateBaudRate(uint32_t rate){ void handleSerial() { - if (pinManager.isPinAllocated(3)) return; + if (pinManager.isPinAllocated(RX)) return; #ifdef WLED_ENABLE_ADALIGHT static auto state = AdaState::Header_A; @@ -72,7 +72,7 @@ void handleSerial() } else if (next == 0xB7) {updateBaudRate(1500000); } else if (next == 'l') { //RGB(W) LED data return as JSON array. Slow, but easy to use on the other end. - if (!pinManager.isPinAllocated(1) || pinManager.getPinOwner(1) == PinOwner::DebugOut){ + if (!pinManager.isPinAllocated(TX) || pinManager.getPinOwner(TX) == PinOwner::DebugOut){ uint16_t used = strip.getLengthTotal(); Serial.write('['); for (uint16_t i=0; i()); //only send response if TX pin is unused for other purposes - if (verboseResponse && (!pinManager.isPinAllocated(1) || pinManager.getPinOwner(1) == PinOwner::DebugOut)) { + if (verboseResponse && (!pinManager.isPinAllocated(TX) || pinManager.getPinOwner(TX) == PinOwner::DebugOut)) { doc.clear(); JsonObject state = doc.createNestedObject("state"); serializeState(state);