make ALL_JSON_TO_PSRAM the default
PSRAM optimizations: always enable ALL_JSON_TO_PSRAM and WLED_USE_PSRAM_JSON
This commit is contained in:
@@ -408,9 +408,9 @@ static String getContentType(AsyncWebServerRequest* request, String filename){
|
||||
}
|
||||
|
||||
#if defined(BOARD_HAS_PSRAM) && defined(WLED_USE_PSRAM)
|
||||
// caching presets in PSRAM may prevent occasional flashes seen when HomeAssitant polls WLED
|
||||
// caching presets in PSRAM may prevent occasional flashes seen when HomeAssistant 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;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
// version code in format yymmddb (b = daily build)
|
||||
#define VERSION 2404280
|
||||
#define VERSION 2404281
|
||||
|
||||
// WLEDMM - you can check for this define in usermods, to only enabled WLEDMM specific code in the "right" fork. Its not defined in AC WLED.
|
||||
#define _MoonModules_WLED_
|
||||
@@ -184,6 +184,12 @@
|
||||
// There is a code that will still not use PSRAM though:
|
||||
// AsyncJsonResponse is a derived class that implements DynamicJsonDocument (AsyncJson-v6.h)
|
||||
#if defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM) && (defined(WLED_USE_PSRAM) || defined(WLED_USE_PSRAM_JSON)) // WLEDMM
|
||||
// WLEDMM the JSON_TO_PSRAM feature works, so use it by default
|
||||
#undef WLED_USE_PSRAM_JSON
|
||||
#define WLED_USE_PSRAM_JSON
|
||||
#undef ALL_JSON_TO_PSRAM
|
||||
#define ALL_JSON_TO_PSRAM
|
||||
|
||||
struct PSRAM_Allocator {
|
||||
void* allocate(size_t size) {
|
||||
if (psramFound()) return ps_malloc(size); // use PSRAM if it exists
|
||||
@@ -802,7 +808,7 @@ WLED_GLOBAL int8_t spi_sclk _INIT(HW_PIN_CLOCKSPI);
|
||||
WLED_GLOBAL PSRAMDynamicJsonDocument doc;
|
||||
#else
|
||||
WLED_GLOBAL PSRAMDynamicJsonDocument doc(JSON_BUFFER_SIZE);
|
||||
#warning experimental - trying to always use dynamic JSON
|
||||
//#warning trying to always use dynamic JSON in PSRAM
|
||||
#endif
|
||||
#else
|
||||
WLED_GLOBAL StaticJsonDocument<JSON_BUFFER_SIZE> doc;
|
||||
|
||||
Reference in New Issue
Block a user