From 2440d8e3d145c7d9d03986572c2ad868a477a2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Kristan?= Date: Thu, 13 Oct 2022 07:51:52 +0200 Subject: [PATCH] Merge branch '0_14' of https://github.com/Aircoookie/WLED into dev --- platformio.ini | 7 ++++--- wled00/bus_wrapper.h | 18 ++++++++++++++---- wled00/const.h | 2 +- wled00/ntp.cpp | 4 ++-- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/platformio.ini b/platformio.ini index 740097595..f128ed6ae 100644 --- a/platformio.ini +++ b/platformio.ini @@ -383,11 +383,12 @@ build_unflags = ${common.build_unflags} lib_deps = ${esp32s2.lib_deps} [env:esp32c3] -board = esp32-c3-devkitm-1 -platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.2/platform-tasmota-espressif32-2.0.2.zip -platform_packages = +platform = espressif32@5.1.1 framework = arduino +board = esp32-c3-devkitm-1 board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv +build_flags = ${common.build_flags} ${esp32c3.build_flags} #-D WLED_RELEASE_NAME=ESP32-C3 + -D WLED_WATCHDOG_TIMEOUT=0 upload_speed = 460800 build_unflags = ${common.build_unflags} lib_deps = ${esp32c3.lib_deps} diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h index 325a1f538..c786f03ab 100644 --- a/wled00/bus_wrapper.h +++ b/wled00/bus_wrapper.h @@ -875,12 +875,22 @@ class PolyBus { } #else //ESP32 uint8_t offset = 0; //0 = RMT (num 0-7) 8 = I2S0 9 = I2S1 - #ifndef CONFIG_IDF_TARGET_ESP32S2 + #ifdef CONFIG_IDF_TARGET_ESP32S2 + // ESP32-S2 only has 4 RMT channels + if (num > 4) return I_NONE; + if (num > 3) offset = num -3; + #elif defined(CONFIG_IDF_TARGET_ESP32C3) + // On ESP32-C3 only the first 2 RMT channels are usable for transmitting + if (num > 1) return I_NONE; + //if (num > 2) offset = num -2; // I2S not supported yet + #elif defined(CONFIG_IDF_TARGET_ESP32S3) + // On ESP32-S3 only the first 4 RMT channels are usable for transmitting + if (num > 3) return I_NONE; + //if (num > 4) offset = num -4; // I2S not supported yet + #else + // standard ESP32 has 8 RMT and 2 I2S channels if (num > 9) return I_NONE; if (num > 7) offset = num -7; - #else //ESP32 S2 only has 4 RMT channels - if (num > 5) return I_NONE; - if (num > 4) offset = num -4; #endif switch (busType) { case TYPE_WS2812_RGB: diff --git a/wled00/const.h b/wled00/const.h index ae8d5d5e6..95b471cb1 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -355,7 +355,7 @@ //this is merely a default now and can be changed at runtime #ifndef LEDPIN -#if defined(ESP8266) || (defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM)) +#if defined(ESP8266) || (defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM)) || defined(CONFIG_IDF_TARGET_ESP32C3) #define LEDPIN 2 // GPIO2 (D4) on Wemod D1 mini compatible boards #else #define LEDPIN 16 // aligns with GPIO2 (D4) on Wemos D1 mini32 compatible boards diff --git a/wled00/ntp.cpp b/wled00/ntp.cpp index accc7e282..0c42cd991 100644 --- a/wled00/ntp.cpp +++ b/wled00/ntp.cpp @@ -93,12 +93,12 @@ void updateTimezone() { break; } case TZ_AUSTRALIA_EASTERN : { - tcrDaylight = {Second, Sun, Oct, 2, 660}; //AEDT = UTC + 11 hours + tcrDaylight = {First, Sun, Oct, 2, 660}; //AEDT = UTC + 11 hours tcrStandard = {First, Sun, Apr, 3, 600}; //AEST = UTC + 10 hours break; } case TZ_NEW_ZEALAND : { - tcrDaylight = {Second, Sun, Sep, 2, 780}; //NZDT = UTC + 13 hours + tcrDaylight = {Last, Sun, Sep, 2, 780}; //NZDT = UTC + 13 hours tcrStandard = {First, Sun, Apr, 3, 720}; //NZST = UTC + 12 hours break; }