mirror of https://github.com/arendst/Tasmota.git
Fix ESP8266 SPI detection
This commit is contained in:
parent
43fd9ee1f2
commit
f1d15c015c
|
@ -1625,8 +1625,8 @@ void GpioInit(void)
|
|||
if (!TasmotaGlobal.soft_spi_enabled) {
|
||||
bool valid_cs = (ValidSpiPinUsed(GPIO_SPI_CS) ||
|
||||
ValidSpiPinUsed(GPIO_RC522_CS) ||
|
||||
ValidSpiPinUsed(GPIO_NRF24_CS) ||
|
||||
ValidSpiPinUsed(GPIO_ILI9341_CS) ||
|
||||
(ValidSpiPinUsed(GPIO_NRF24_CS) && ValidSpiPinUsed(GPIO_NRF24_DC)) ||
|
||||
(ValidSpiPinUsed(GPIO_ILI9341_CS) && ValidSpiPinUsed(GPIO_ILI9341_DC)) ||
|
||||
ValidSpiPinUsed(GPIO_EPAPER29_CS) ||
|
||||
ValidSpiPinUsed(GPIO_EPAPER42_CS) ||
|
||||
ValidSpiPinUsed(GPIO_ILI9488_CS) ||
|
||||
|
@ -1634,17 +1634,11 @@ void GpioInit(void)
|
|||
ValidSpiPinUsed(GPIO_RA8876_CS) ||
|
||||
ValidSpiPinUsed(GPIO_ST7789_DC) || // ST7789 CS may be omitted so chk DC too
|
||||
ValidSpiPinUsed(GPIO_ST7789_CS) ||
|
||||
ValidSpiPinUsed(GPIO_SSD1331_CS) ||
|
||||
(ValidSpiPinUsed(GPIO_SSD1331_CS) && ValidSpiPinUsed(GPIO_SSD1331_DC)) ||
|
||||
ValidSpiPinUsed(GPIO_SDCARD_CS)
|
||||
);
|
||||
bool valid_dc = (ValidSpiPinUsed(GPIO_SPI_DC) ||
|
||||
ValidSpiPinUsed(GPIO_NRF24_DC) ||
|
||||
ValidSpiPinUsed(GPIO_ILI9341_DC) ||
|
||||
ValidSpiPinUsed(GPIO_ST7789_DC) ||
|
||||
ValidSpiPinUsed(GPIO_SSD1331_DC)
|
||||
);
|
||||
// If SPI_CS and/or SPI_DC is used they must be valid
|
||||
TasmotaGlobal.spi_enabled = (valid_cs && valid_dc) ? SPI_MOSI_MISO : SPI_NONE;
|
||||
TasmotaGlobal.spi_enabled = (valid_cs) ? SPI_MOSI_MISO : SPI_NONE;
|
||||
if (TasmotaGlobal.spi_enabled) {
|
||||
TasmotaGlobal.my_module.io[12] = AGPIO(GPIO_SPI_MISO);
|
||||
SetPin(12, AGPIO(GPIO_SPI_MISO));
|
||||
|
|
Loading…
Reference in New Issue