diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 09888de..da0d232 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -14,32 +14,32 @@ CONFIG_HEAP_CORRUPTION_DETECTION=CONFIG_HEAP_POISONING_LIGHT CONFIG_HEAP_POISONING_LIGHT=y CONFIG_ESP32S3_SPIRAM_SUPPORT=y -CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y -CONFIG_BOOTLOADER_LOG_LEVEL=0 -CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y -CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y -CONFIG_ESP32S3_SPIRAM_SUPPORT=y -CONFIG_LOG_DEFAULT_LEVEL_NONE=y -CONFIG_LOG_DEFAULT_LEVEL=0 -CONFIG_LOG_MAXIMUM_LEVEL=0 -CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y -CONFIG_LOG_BOOTLOADER_LEVEL=0 -CONFIG_CXX_EXCEPTIONS=y -CONFIG_COMPILER_CXX_EXCEPTIONS=y +CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=n +#CONFIG_BOOTLOADER_LOG_LEVEL=0 +#CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y +#CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +#CONFIG_ESP32S3_SPIRAM_SUPPORT=y +#CONFIG_LOG_DEFAULT_LEVEL_NONE=y +#CONFIG_LOG_DEFAULT_LEVEL=0 +#CONFIG_LOG_MAXIMUM_LEVEL=0 +#CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y +#CONFIG_LOG_BOOTLOADER_LEVEL=0 +#CONFIG_CXX_EXCEPTIONS=y +#CONFIG_COMPILER_CXX_EXCEPTIONS=y #CONFIG_BOOTLOADER_WDT_ENABLE=n #CONFIG_TASK_WDT=n #Required for BTClock -#CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_MODE_OCT=y #CONFIG_SPIRAM_MODE_QUAD=n # Save RAM -CONFIG_LWIP_IPV4=y -CONFIG_LWIP_IPV6=y -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=6 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=12 -CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=12 -CONFIG_ESP32_WIFI_RX_BA_WIN=6 +#CONFIG_LWIP_IPV4=y +#CONFIG_LWIP_IPV6=y +#CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=6 +#CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=12 +#CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=12 +#CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=3120 CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240 diff --git a/src/lib/config.cpp b/src/lib/config.cpp index 09cf4fc..a7a78cc 100644 --- a/src/lib/config.cpp +++ b/src/lib/config.cpp @@ -11,6 +11,7 @@ std::vector screenNameMap(SCREEN_COUNT); std::mutex mcpMutex; void setup() { + Serial.println("Echo test"); setupPreferences(); setupHardware(); setupDisplays(); @@ -28,12 +29,15 @@ void setup() { } } - tryImprovSetup(); - - setupWebserver(); + // tryImprovSetup(); + // setupWebserver(); + uint32_t brown_reg_temp = READ_PERI_REG(RTC_CNTL_BROWN_OUT_REG); //save WatchDog register + WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector + WiFi.begin(); + WiFi.setTxPower(WIFI_POWER_11dBm); // setupWifi(); - setupTime(); + //setupTime(); finishSetup(); setupTasks(); @@ -50,6 +54,9 @@ void setup() { } void tryImprovSetup() { + uint32_t brown_reg_temp = READ_PERI_REG(RTC_CNTL_BROWN_OUT_REG); //save WatchDog register + WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector + WiFi.onEvent(WiFiEvent); if (!preferences.getBool("wifiConfigured", false)) { @@ -237,7 +244,7 @@ void setupMcp() { const int mcp1AddrValues[] = {LOW, LOW, LOW}; const int mcp2AddrPins[] = {MCP2_A0_PIN, MCP2_A1_PIN, MCP2_A2_PIN}; - const int mcp2AddrValues[] = {LOW, LOW, HIGH}; + const int mcp2AddrValues[] = {HIGH, LOW, LOW}; pinMode(MCP_RESET_PIN, OUTPUT); digitalWrite(MCP_RESET_PIN, HIGH); @@ -277,7 +284,7 @@ void setupHardware() { Wire.begin(I2C_SDA_PIN, I2C_SCK_PIN, 400000); if (!mcp1.begin_I2C(0x20)) { - Serial.println(F("Error MCP23017")); + Serial.println(F("Error MCP23017 1")); // while (1) // ; @@ -298,7 +305,7 @@ void setupHardware() { #ifdef IS_BTCLOCK_S3 if (!mcp2.begin_I2C(0x21)) { - Serial.println(F("Error MCP23017")); + Serial.println(F("Error MCP23017 2")); // while (1) // ; diff --git a/src/lib/config.hpp b/src/lib/config.hpp index 228beea..8207282 100644 --- a/src/lib/config.hpp +++ b/src/lib/config.hpp @@ -6,6 +6,8 @@ #include #include #include +#include "soc/soc.h" +#include "soc/rtc_cntl_reg.h" #include diff --git a/src/lib/epd.cpp b/src/lib/epd.cpp index 921cc44..595ba48 100644 --- a/src/lib/epd.cpp +++ b/src/lib/epd.cpp @@ -123,11 +123,11 @@ void setupDisplays() { int *taskParam = new int; *taskParam = i; - xTaskCreate(updateDisplay, ("EpdUpd" + String(i)).c_str(), 2048, taskParam, + xTaskCreate(updateDisplay, ("EpdUpd" + String(i)).c_str(), 8192, taskParam, 11, &tasks[i]); // create task } - epdContent = {"B", "T", "C", "L", "O", "C", "K"}; + epdContent = {"B", "T", "C", "L", "O", "C", "K", "V2"}; setEpdContent(epdContent); }