mirror of https://github.com/arendst/Tasmota.git
Esp32c3 fix compilation for SPI and uDisplay
This commit is contained in:
parent
d0cd897ea0
commit
2d5841af9c
|
@ -38,3 +38,17 @@
|
|||
#define __UINT32_TYPE__ unsigned int
|
||||
|
||||
#endif // __riscv
|
||||
|
||||
// fix a bug in esp-idf 4.4 for esp32c3
|
||||
#ifndef REG_SPI_BASE
|
||||
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 )))
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
// SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG
|
||||
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
|
||||
//alias for different chips, deprecated for the chips after esp32s2
|
||||
#define SPI_HOST SPI1_HOST
|
||||
#define HSPI_HOST SPI2_HOST
|
||||
#define VSPI_HOST SPI3_HOST
|
||||
#endif
|
|
@ -29,9 +29,9 @@ License along with NeoPixel. If not, see
|
|||
|
||||
#include "driver/spi_master.h"
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(HSPI_HOST)
|
||||
// HSPI_HOST depreciated in C3
|
||||
#define HSPI_HOST SPI3_HOST
|
||||
#define HSPI_HOST SPI2_HOST
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
|
|
|
@ -54,8 +54,13 @@ enum uColorType { uCOLOR_BW, uCOLOR_COLOR };
|
|||
#undef GPIO_CLR
|
||||
#undef GPIO_SET_SLOW
|
||||
#undef GPIO_CLR_SLOW
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#define GPIO_CLR(A) GPIO.out_w1tc.val = (1 << A)
|
||||
#define GPIO_SET(A) GPIO.out_w1ts.val = (1 << A)
|
||||
#else // plain ESP32
|
||||
#define GPIO_CLR(A) GPIO.out_w1tc = (1 << A)
|
||||
#define GPIO_SET(A) GPIO.out_w1ts = (1 << A)
|
||||
#endif
|
||||
#define GPIO_CLR_SLOW(A) digitalWrite(A, LOW)
|
||||
#define GPIO_SET_SLOW(A) digitalWrite(A, HIGH)
|
||||
|
||||
|
|
Loading…
Reference in New Issue