CONFIG_IDF_TARGET not a compile flag anymore (#799)

This commit is contained in:
Michael Miller
2024-04-24 11:06:33 -07:00
committed by GitHub
parent 2e88d03c4e
commit e40289f89c
5 changed files with 58 additions and 14 deletions

View File

@@ -54,15 +54,15 @@ License along with NeoPixel. If not, see
#elif defined(ARDUINO_ARCH_ESP32) #elif defined(ARDUINO_ARCH_ESP32)
#if !defined(ARDUINO_ESP32C6_DEV) && !defined(ARDUINO_ESP32H2_DEV) #if !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#include "methods/NeoEsp32I2sMethod.h" #include "methods/NeoEsp32I2sMethod.h"
#include "methods/NeoEsp32RmtMethod.h" #include "methods/NeoEsp32RmtMethod.h"
#include "methods/DotStarEsp32DmaSpiMethod.h" #include "methods/DotStarEsp32DmaSpiMethod.h"
#include "methods/NeoEsp32I2sXMethod.h" #include "methods/NeoEsp32I2sXMethod.h"
#include "methods/NeoEspBitBangMethod.h"
#endif
#endif
#include "methods/NeoEspBitBangMethod.h"
#elif defined(ARDUINO_ARCH_NRF52840) // must be before __arm__ #elif defined(ARDUINO_ARCH_NRF52840) // must be before __arm__

View File

@@ -14,11 +14,13 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// ESP32 C3 & S3 I2S is not supported yet due to significant changes to interface #if defined(ARDUINO_ARCH_ESP32)
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(ARDUINO_ESP32C3_DEV) && !defined(ARDUINO_ESP32S3_DEV) && !defined(ARDUINO_ESP32C6_DEV) && !defined(ARDUINO_ESP32H2_DEV)
#include "sdkconfig.h" // this sets useful config symbols, like CONFIG_IDF_TARGET_ESP32C3 #include "sdkconfig.h" // this sets useful config symbols, like CONFIG_IDF_TARGET_ESP32C3
// ESP32 C3, S3, C6, and H2 I2S is not supported yet due to significant changes to interface
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "stdlib.h" #include "stdlib.h"
@@ -47,7 +49,6 @@
#include "soc/dport_reg.h" #include "soc/dport_reg.h"
#endif #endif
#include "soc/sens_reg.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/i2s.h" #include "driver/i2s.h"
@@ -1046,5 +1047,6 @@ bool i2sGetClks(uint8_t bus_num,
} }
#endif #endif
#endif // defined(ARDUINO_ARCH_ESP32) ** !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) #endif // !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#endif // defined(ARDUINO_ARCH_ESP32)

View File

@@ -27,9 +27,10 @@ License along with NeoPixel. If not, see
<http://www.gnu.org/licenses/>. <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
#if defined(ARDUINO_ARCH_ESP32) && !defined(ARDUINO_ESP32C6_DEV) && !defined(ARDUINO_ESP32H2_DEV)
#include <Arduino.h> #include <Arduino.h>
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#include "../NeoSettings.h" #include "../NeoSettings.h"
#include "../NeoBusChannel.h" #include "../NeoBusChannel.h"
#include "NeoEsp32RmtMethod.h" #include "NeoEsp32RmtMethod.h"

View File

@@ -24,10 +24,10 @@ License along with NeoPixel. If not, see
<http://www.gnu.org/licenses/>. <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) && !defined(ARDUINO_ESP32C6_DEV) && !defined(ARDUINO_ESP32H2_DEV)
#include <Arduino.h> #include <Arduino.h>
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
#if ESP_IDF_VERSION_MAJOR>=5 #if ESP_IDF_VERSION_MAJOR>=5
#include <soc/gpio_struct.h> #include <soc/gpio_struct.h>
#endif #endif
@@ -36,7 +36,7 @@ static inline uint32_t getCycleCount(void)
{ {
uint32_t ccount; uint32_t ccount;
#if defined(CONFIG_IDF_TARGET_ESP32C3) #if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
__asm__ __volatile__("csrr %0,0x7e2":"=r" (ccount)); __asm__ __volatile__("csrr %0,0x7e2":"=r" (ccount));
//ccount = esp_cpu_get_ccount(); //ccount = esp_cpu_get_ccount();
#else #else
@@ -110,7 +110,7 @@ bool IRAM_ATTR neoEspBitBangWriteSpacingPixels(const uint8_t* pixels,
uint32_t cyclesNext = 0; uint32_t cyclesNext = 0;
#if defined(ARDUINO_ARCH_ESP32) #if defined(ARDUINO_ARCH_ESP32)
#if defined(CONFIG_IDF_TARGET_ESP32C3) #if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
volatile uint32_t* setRegister = &GPIO.out_w1ts.val; volatile uint32_t* setRegister = &GPIO.out_w1ts.val;
volatile uint32_t* clearRegister = &GPIO.out_w1tc.val; volatile uint32_t* clearRegister = &GPIO.out_w1tc.val;
setValue = _BV(pin); setValue = _BV(pin);
@@ -118,7 +118,7 @@ bool IRAM_ATTR neoEspBitBangWriteSpacingPixels(const uint8_t* pixels,
#else #else
volatile uint32_t* setRegister = &GPIO.out_w1ts; volatile uint32_t* setRegister = &GPIO.out_w1ts;
volatile uint32_t* clearRegister = &GPIO.out_w1tc; volatile uint32_t* clearRegister = &GPIO.out_w1tc;
#endif // defined(CONFIG_IDF_TARGET_ESP32C3) #endif // defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
#else #else
uint32_t setRegister = PERIPHS_GPIO_BASEADDR + GPIO_OUT_W1TS_ADDRESS; uint32_t setRegister = PERIPHS_GPIO_BASEADDR + GPIO_OUT_W1TS_ADDRESS;
uint32_t clearRegister = PERIPHS_GPIO_BASEADDR + GPIO_OUT_W1TC_ADDRESS; uint32_t clearRegister = PERIPHS_GPIO_BASEADDR + GPIO_OUT_W1TC_ADDRESS;

View File

@@ -360,6 +360,45 @@ typedef NeoEsp32BitBangWs2805InvertedMethod NeoEsp32BitBangWs2814InvertedNoIntrM
typedef NeoEsp32BitBangTm1814InvertedMethod NeoEsp32BitBangTm1914InvertedNoIntrMethod; typedef NeoEsp32BitBangTm1814InvertedMethod NeoEsp32BitBangTm1914InvertedNoIntrMethod;
typedef NeoEsp32BitBangSk6812InvertedMethod NeoEsp32BitBangLc8812InvertedNoIntrMethod; typedef NeoEsp32BitBangSk6812InvertedMethod NeoEsp32BitBangLc8812InvertedNoIntrMethod;
#if defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
//
// Esp32 C6 && H2 currently use BitBang as the default until other support
// is created, as they are not compatible with older generation chips
typedef NeoEsp32BitBangWs2812xMethod NeoWs2813Method;
typedef NeoEsp32BitBangWs2812xMethod NeoWs2812xMethod;
typedef NeoEsp32BitBang800KbpsMethod NeoWs2812Method;
typedef NeoEsp32BitBangWs2812xMethod NeoWs2811Method;
typedef NeoEsp32BitBangWs2812xMethod NeoWs2816Method;
typedef NeoEsp32BitBangWs2805Method NeoWs2805Method;
typedef NeoEsp32BitBangWs2814Method NeoWs2814Method;
typedef NeoEsp32BitBangSk6812Method NeoSk6812Method;
typedef NeoEsp32BitBangTm1814Method NeoTm1814Method;
typedef NeoEsp32BitBangTm1829Method NeoTm1829Method;
typedef NeoEsp32BitBangTm1914Method NeoTm1914Method;
typedef NeoEsp32BitBangSk6812Method NeoLc8812Method;
typedef NeoEsp32BitBangApa106Method NeoApa106Method;
typedef NeoEsp32BitBangWs2812xMethod Neo800KbpsMethod;
typedef NeoEsp32BitBang400KbpsMethod Neo400KbpsMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod NeoWs2813InvertedMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod NeoWs2812xInvertedMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod NeoWs2811InvertedMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod NeoWs2816InvertedMethod;
typedef NeoEsp32BitBangWs2805InvertedMethod NeoWs2805InvertedMethod;
typedef NeoEsp32BitBangWs2814InvertedMethod NeoWs2814InvertedMethod;
typedef NeoEsp32BitBang800KbpsInvertedMethod NeoWs2812InvertedMethod;
typedef NeoEsp32BitBangSk6812InvertedMethod NeoSk6812InvertedMethod;
typedef NeoEsp32BitBangTm1814InvertedMethod NeoTm1814InvertedMethod;
typedef NeoEsp32BitBangTm1829InvertedMethod NeoTm1829InvertedMethod;
typedef NeoEsp32BitBangTm1914InvertedMethod NeoTm1914InvertedMethod;
typedef NeoEsp32BitBangSk6812InvertedMethod NeoLc8812InvertedMethod;
typedef NeoEsp32BitBangApa106InvertedMethod NeoApa106InvertedMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod Neo800KbpsInvertedMethod;
typedef NeoEsp32BitBang400KbpsInvertedMethod Neo400KbpsInvertedMethod;
#endif
#else // defined(ARDUINO_ARCH_ESP8266) #else // defined(ARDUINO_ARCH_ESP8266)
typedef NeoEspBitBangMethodBase<NeoEspBitBangSpeedWs2811, NeoEspNotInverted, true> NeoEsp8266BitBangWs2811Method; typedef NeoEspBitBangMethodBase<NeoEspBitBangSpeedWs2811, NeoEspNotInverted, true> NeoEsp8266BitBangWs2811Method;
@@ -434,6 +473,8 @@ typedef NeoEsp8266BitBangWs2805InvertedMethod NeoEsp8266BitBangWs2814InvertedNoI
typedef NeoEsp8266BitBangTm1814InvertedMethod NeoEsp8266BitBangTm1914InvertedNoIntrMethod; typedef NeoEsp8266BitBangTm1814InvertedMethod NeoEsp8266BitBangTm1914InvertedNoIntrMethod;
typedef NeoEsp8266BitBangSk6812InvertedMethod NeoEsp8266BitBangLc8812InvertedNoIntrMethod; typedef NeoEsp8266BitBangSk6812InvertedMethod NeoEsp8266BitBangLc8812InvertedNoIntrMethod;
#endif // defined(ARDUINO_ARCH_ESP32) #endif // defined(ARDUINO_ARCH_ESP32)
// ESP bitbang doesn't have defaults and should avoided except for testing // ESP bitbang doesn't have defaults and should avoided except for testing