From 663f29d4e3cb28b30477a46f656cacb2eb977993 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 17 Apr 2021 19:49:26 +0200 Subject: [PATCH] Enable second HW SPI for ESP32 --- tasmota/tasmota.h | 2 ++ tasmota/tasmota_template.h | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index bd8c392ee..e0ad51e8e 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -87,8 +87,10 @@ const uint16_t VL53L0X_MAX_SENSORS = 8; // Max number of VL53L0X sensors #ifdef ESP32 const uint8_t MAX_I2C = 2; // Max number of I2C controllers (ESP32 = 2) +const uint8_t MAX_SPI = 2; // Max number of Hardware SPI controllers (ESP32 = 2) #else const uint8_t MAX_I2C = 0; // Max number of I2C controllers (ESP8266 = 0, no choice) +const uint8_t MAX_SPI = 0; // Max number of Hardware SPI controllers (ESP8266 = 0, no choice) #endif // Changes to the following MAX_ defines need to be in line with enum SettingsTextIndex diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 74940db07..913889e49 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -407,11 +407,11 @@ const uint16_t kGpioNiceList[] PROGMEM = { #endif #ifdef USE_SPI - AGPIO(GPIO_SPI_MISO), // SPI MISO - AGPIO(GPIO_SPI_MOSI), // SPI MOSI - AGPIO(GPIO_SPI_CLK), // SPI Clk - AGPIO(GPIO_SPI_CS), // SPI Chip Select - AGPIO(GPIO_SPI_DC), // SPI Data Direction + AGPIO(GPIO_SPI_MISO) + MAX_SPI, // SPI MISO + AGPIO(GPIO_SPI_MOSI) + MAX_SPI, // SPI MOSI + AGPIO(GPIO_SPI_CLK) + MAX_SPI, // SPI Clk + AGPIO(GPIO_SPI_CS) + MAX_SPI, // SPI Chip Select + AGPIO(GPIO_SPI_DC) + MAX_SPI, // SPI Data Direction #ifdef USE_NRF24 AGPIO(GPIO_NRF24_CS), AGPIO(GPIO_NRF24_DC),