increase STACK_BUF_SIZE after PR#59

* increase buffer by 64 bytes (sting added in AR usermod)
* better diag message when buffer is full
* change "Arduino  max stack" to debug message
This commit is contained in:
Frank
2023-07-27 12:45:14 +02:00
parent d23ca8beaf
commit 39db568ca9
4 changed files with 7 additions and 4 deletions

View File

@@ -2473,7 +2473,7 @@ class AudioReactive : public Usermod {
oappend(SET_F("addOption(dd,'Off',0);"));
oappend(SET_F("addOption(dd,'Send',1);"));
oappend(SET_F("addOption(dd,'Receive',2);"));
oappend(SET_F("addInfo('AudioReactive:sync:mode',1,'Sync audio data with other WLEDs');"));
oappend(SET_F("addInfo('AudioReactive:sync:mode',1,'<br> Sync audio data with other WLEDs');"));
oappend(SET_F("addInfo('AudioReactive:digitalmic:type',1,'<i>requires reboot!</i>');")); // 0 is field type, 1 is actual field

View File

@@ -382,7 +382,7 @@
#ifdef ESP8266
#define SETTINGS_STACK_BUF_SIZE 2048
#else
#define SETTINGS_STACK_BUF_SIZE 3712 // WLEDMM added 512 bytes of margin (was 3096)
#define SETTINGS_STACK_BUF_SIZE 3776 // WLEDMM added 680 bytes of margin (was 3096) for audioreactive UI
#endif
#ifdef WLED_USE_ETHERNET

View File

@@ -149,7 +149,10 @@ bool oappend(const char* txt)
{
uint16_t len = strlen(txt);
if (olen + len >= SETTINGS_STACK_BUF_SIZE) {
DEBUG_PRINTLN(F("oappend() error: buffer full. Increase SETTINGS_STACK_BUF_SIZE."));
USER_PRINT(F("oappend() error: buffer full. Increase SETTINGS_STACK_BUF_SIZE for "));
USER_PRINTF("%2u bytes \t\"", len /*1 + olen + len - SETTINGS_STACK_BUF_SIZE*/);
USER_PRINT(txt);
USER_PRINTLN(F("\""));
return false; // buffer full
}
strcpy(obuf + olen, txt);

View File

@@ -526,7 +526,7 @@ void WLED::setup()
DEBUG_PRINT(F("heap ")); DEBUG_PRINTLN(ESP.getFreeHeap());
#ifdef ARDUINO_ARCH_ESP32
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0) // unfortunately not availeable in older framework versions
USER_PRINT(F("\nArduino max stack ")); USER_PRINTLN(getArduinoLoopTaskStackSize());
DEBUG_PRINT(F("\nArduino max stack ")); DEBUG_PRINTLN(getArduinoLoopTaskStackSize());
#endif
DEBUG_PRINTF("%s min free stack %d\n", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL)); //WLEDMM
#endif