mirror of
https://github.com/btclock/btclock_v3.git
synced 2024-11-19 02:20:02 +01:00
S3 OSPIRAM specific code
This commit is contained in:
parent
1f937d94fe
commit
2882240d0c
@ -14,32 +14,32 @@ CONFIG_HEAP_CORRUPTION_DETECTION=CONFIG_HEAP_POISONING_LIGHT
|
|||||||
CONFIG_HEAP_POISONING_LIGHT=y
|
CONFIG_HEAP_POISONING_LIGHT=y
|
||||||
|
|
||||||
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
|
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
|
||||||
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
|
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=n
|
||||||
CONFIG_BOOTLOADER_LOG_LEVEL=0
|
#CONFIG_BOOTLOADER_LOG_LEVEL=0
|
||||||
CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y
|
#CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y
|
||||||
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
|
#CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
|
||||||
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
|
#CONFIG_ESP32S3_SPIRAM_SUPPORT=y
|
||||||
CONFIG_LOG_DEFAULT_LEVEL_NONE=y
|
#CONFIG_LOG_DEFAULT_LEVEL_NONE=y
|
||||||
CONFIG_LOG_DEFAULT_LEVEL=0
|
#CONFIG_LOG_DEFAULT_LEVEL=0
|
||||||
CONFIG_LOG_MAXIMUM_LEVEL=0
|
#CONFIG_LOG_MAXIMUM_LEVEL=0
|
||||||
CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y
|
#CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y
|
||||||
CONFIG_LOG_BOOTLOADER_LEVEL=0
|
#CONFIG_LOG_BOOTLOADER_LEVEL=0
|
||||||
CONFIG_CXX_EXCEPTIONS=y
|
#CONFIG_CXX_EXCEPTIONS=y
|
||||||
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
#CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
||||||
#CONFIG_BOOTLOADER_WDT_ENABLE=n
|
#CONFIG_BOOTLOADER_WDT_ENABLE=n
|
||||||
#CONFIG_TASK_WDT=n
|
#CONFIG_TASK_WDT=n
|
||||||
|
|
||||||
#Required for BTClock
|
#Required for BTClock
|
||||||
#CONFIG_SPIRAM_MODE_OCT=y
|
CONFIG_SPIRAM_MODE_OCT=y
|
||||||
#CONFIG_SPIRAM_MODE_QUAD=n
|
#CONFIG_SPIRAM_MODE_QUAD=n
|
||||||
|
|
||||||
# Save RAM
|
# Save RAM
|
||||||
CONFIG_LWIP_IPV4=y
|
#CONFIG_LWIP_IPV4=y
|
||||||
CONFIG_LWIP_IPV6=y
|
#CONFIG_LWIP_IPV6=y
|
||||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=6
|
#CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=6
|
||||||
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=12
|
#CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=12
|
||||||
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=12
|
#CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=12
|
||||||
CONFIG_ESP32_WIFI_RX_BA_WIN=6
|
#CONFIG_ESP32_WIFI_RX_BA_WIN=6
|
||||||
|
|
||||||
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=3120
|
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=3120
|
||||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240
|
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240
|
||||||
|
@ -11,6 +11,7 @@ std::vector<std::string> screenNameMap(SCREEN_COUNT);
|
|||||||
std::mutex mcpMutex;
|
std::mutex mcpMutex;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
Serial.println("Echo test");
|
||||||
setupPreferences();
|
setupPreferences();
|
||||||
setupHardware();
|
setupHardware();
|
||||||
setupDisplays();
|
setupDisplays();
|
||||||
@ -28,12 +29,15 @@ void setup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tryImprovSetup();
|
// tryImprovSetup();
|
||||||
|
|
||||||
setupWebserver();
|
|
||||||
|
|
||||||
|
// 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();
|
// setupWifi();
|
||||||
setupTime();
|
//setupTime();
|
||||||
finishSetup();
|
finishSetup();
|
||||||
|
|
||||||
setupTasks();
|
setupTasks();
|
||||||
@ -50,6 +54,9 @@ void setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void tryImprovSetup() {
|
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);
|
WiFi.onEvent(WiFiEvent);
|
||||||
|
|
||||||
if (!preferences.getBool("wifiConfigured", false)) {
|
if (!preferences.getBool("wifiConfigured", false)) {
|
||||||
@ -237,7 +244,7 @@ void setupMcp() {
|
|||||||
const int mcp1AddrValues[] = {LOW, LOW, LOW};
|
const int mcp1AddrValues[] = {LOW, LOW, LOW};
|
||||||
|
|
||||||
const int mcp2AddrPins[] = {MCP2_A0_PIN, MCP2_A1_PIN, MCP2_A2_PIN};
|
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);
|
pinMode(MCP_RESET_PIN, OUTPUT);
|
||||||
digitalWrite(MCP_RESET_PIN, HIGH);
|
digitalWrite(MCP_RESET_PIN, HIGH);
|
||||||
@ -277,7 +284,7 @@ void setupHardware() {
|
|||||||
Wire.begin(I2C_SDA_PIN, I2C_SCK_PIN, 400000);
|
Wire.begin(I2C_SDA_PIN, I2C_SCK_PIN, 400000);
|
||||||
|
|
||||||
if (!mcp1.begin_I2C(0x20)) {
|
if (!mcp1.begin_I2C(0x20)) {
|
||||||
Serial.println(F("Error MCP23017"));
|
Serial.println(F("Error MCP23017 1"));
|
||||||
|
|
||||||
// while (1)
|
// while (1)
|
||||||
// ;
|
// ;
|
||||||
@ -298,7 +305,7 @@ void setupHardware() {
|
|||||||
|
|
||||||
#ifdef IS_BTCLOCK_S3
|
#ifdef IS_BTCLOCK_S3
|
||||||
if (!mcp2.begin_I2C(0x21)) {
|
if (!mcp2.begin_I2C(0x21)) {
|
||||||
Serial.println(F("Error MCP23017"));
|
Serial.println(F("Error MCP23017 2"));
|
||||||
|
|
||||||
// while (1)
|
// while (1)
|
||||||
// ;
|
// ;
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#include <WiFiManager.h>
|
#include <WiFiManager.h>
|
||||||
#include <base64.h>
|
#include <base64.h>
|
||||||
#include <esp_task_wdt.h>
|
#include <esp_task_wdt.h>
|
||||||
|
#include "soc/soc.h"
|
||||||
|
#include "soc/rtc_cntl_reg.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
@ -123,11 +123,11 @@ void setupDisplays() {
|
|||||||
int *taskParam = new int;
|
int *taskParam = new int;
|
||||||
*taskParam = i;
|
*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
|
11, &tasks[i]); // create task
|
||||||
}
|
}
|
||||||
|
|
||||||
epdContent = {"B", "T", "C", "L", "O", "C", "K"};
|
epdContent = {"B", "T", "C", "L", "O", "C", "K", "V2"};
|
||||||
|
|
||||||
setEpdContent(epdContent);
|
setEpdContent(epdContent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user