mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 08:55:22 +01:00
Fix SPI HW selection for ESP32 variants (#3728)
This commit is contained in:
parent
a47e92f2bc
commit
ac3cdf487f
1 changed files with 4 additions and 0 deletions
|
@ -76,7 +76,11 @@ void SPIComponent::setup() {
|
||||||
if (spi_bus_num == 0) {
|
if (spi_bus_num == 0) {
|
||||||
this->hw_spi_ = &SPI;
|
this->hw_spi_ = &SPI;
|
||||||
} else {
|
} else {
|
||||||
|
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3)
|
||||||
|
this->hw_spi_ = new SPIClass(FSPI); // NOLINT(cppcoreguidelines-owning-memory)
|
||||||
|
#else
|
||||||
this->hw_spi_ = new SPIClass(VSPI); // NOLINT(cppcoreguidelines-owning-memory)
|
this->hw_spi_ = new SPIClass(VSPI); // NOLINT(cppcoreguidelines-owning-memory)
|
||||||
|
#endif // USE_ESP32_VARIANT
|
||||||
}
|
}
|
||||||
spi_bus_num++;
|
spi_bus_num++;
|
||||||
this->hw_spi_->begin(clk_pin, miso_pin, mosi_pin);
|
this->hw_spi_->begin(clk_pin, miso_pin, mosi_pin);
|
||||||
|
|
Loading…
Reference in a new issue