mirror of
https://github.com/wled/WLED.git
synced 2026-04-20 06:04:29 +00:00
simplify and correct some long ifdef chains
* C5: allow BOARD_HAS_PSRAM * assign MIN_FRAME_DELAY based on number of CPU cores
This commit is contained in:
10
wled00/FX.h
10
wled00/FX.h
@@ -70,10 +70,12 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
|
||||
#define WLED_FPS 42
|
||||
#define FRAMETIME_FIXED (1000/WLED_FPS)
|
||||
#define FRAMETIME strip.getFrameTime()
|
||||
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
#define MIN_FRAME_DELAY 2 // minimum wait between repaints, to keep other functions like WiFi alive
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5)
|
||||
#define MIN_FRAME_DELAY 3 // S2/C3/C5 are slower than normal esp32, and only have one core
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#if (SOC_CPU_CORES_NUM < 2)
|
||||
#define MIN_FRAME_DELAY 3 // S2/C3/C6/C5 are slower than normal esp32, and only have one core
|
||||
#else
|
||||
#define MIN_FRAME_DELAY 2 // classic esp32/S3/P4: minimum wait between repaints, to keep other functions like WiFi alive
|
||||
#endif
|
||||
#else
|
||||
#define MIN_FRAME_DELAY 8 // 8266 legacy MIN_SHOW_DELAY
|
||||
#endif
|
||||
|
||||
@@ -637,8 +637,8 @@ int32_t hw_random(int32_t lowerlimit, int32_t upperlimit) {
|
||||
|
||||
// PSRAM compile time checks to provide info for misconfigured env
|
||||
#if defined(BOARD_HAS_PSRAM)
|
||||
#if defined(IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C61) || defined(ESP8266)
|
||||
#error "ESP32-C3/C5 and ESP8266 with PSRAM is not supported, please remove BOARD_HAS_PSRAM definition"
|
||||
#if defined(IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(ESP8266)
|
||||
#error "ESP32-C3/C6 and ESP8266 with PSRAM is not supported, please remove BOARD_HAS_PSRAM definition"
|
||||
#else
|
||||
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3) // PSRAM fix only needed for classic esp32
|
||||
// BOARD_HAS_PSRAM also means that compiler flag "-mfix-esp32-psram-cache-issue" has to be used for old "rev.1" esp32
|
||||
|
||||
Reference in New Issue
Block a user