Multi-update
- 0.15.0-b2 - WS2805 support (NeoPixelBus 2.7.9) - generic PSRAM support (ESP32 rev.1 still needs compile fix) - BREAKING: default LEDPIN 2 (due to PSRAM) - PinManager optimisations
This commit is contained in:
@@ -376,20 +376,15 @@ void updateFSInfo() {
|
||||
}
|
||||
|
||||
|
||||
#if defined(BOARD_HAS_PSRAM) && defined(WLED_USE_PSRAM)
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
// caching presets in PSRAM may prevent occasional flashes seen when HomeAssitant polls WLED
|
||||
// original idea by @akaricchi (https://github.com/Akaricchi)
|
||||
// returns a pointer to the PSRAM buffer updates size parameter
|
||||
// returns a pointer to the PSRAM buffer, updates size parameter
|
||||
static const uint8_t *getPresetCache(size_t &size) {
|
||||
static unsigned long presetsCachedTime;
|
||||
static uint8_t *presetsCached;
|
||||
static size_t presetsCachedSize;
|
||||
|
||||
if (!psramFound()) {
|
||||
size = 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (presetsModifiedTime != presetsCachedTime) {
|
||||
if (presetsCached) {
|
||||
free(presetsCached);
|
||||
@@ -421,8 +416,8 @@ bool handleFileRead(AsyncWebServerRequest* request, String path){
|
||||
DEBUG_PRINT(F("WS FileRead: ")); DEBUG_PRINTLN(path);
|
||||
if(path.endsWith("/")) path += "index.htm";
|
||||
if(path.indexOf(F("sec")) > -1) return false;
|
||||
#if defined(BOARD_HAS_PSRAM) && defined(WLED_USE_PSRAM)
|
||||
if (path.endsWith(FPSTR(getPresetsFileName()))) {
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
if (psramFound() && path.endsWith(FPSTR(getPresetsFileName()))) {
|
||||
size_t psize;
|
||||
const uint8_t *presets = getPresetCache(psize);
|
||||
if (presets) {
|
||||
|
||||
Reference in New Issue
Block a user