From bf4d3df906bc35d5ec128874b27d9f25977177cd Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 28 Oct 2022 12:33:15 +1300 Subject: [PATCH] Fix RP2040 SPISettings (#3960) --- esphome/components/spi/spi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esphome/components/spi/spi.h b/esphome/components/spi/spi.h index bc183be54b..b7124302f4 100644 --- a/esphome/components/spi/spi.h +++ b/esphome/components/spi/spi.h @@ -225,7 +225,11 @@ class SPIComponent : public Component { } else if (CLOCK_POLARITY && CLOCK_PHASE) { data_mode = SPI_MODE3; } +#ifdef USE_RP2040 + SPISettings settings(DATA_RATE, static_cast(BIT_ORDER), data_mode); +#else SPISettings settings(DATA_RATE, BIT_ORDER, data_mode); +#endif this->hw_spi_->beginTransaction(settings); } else { #endif // USE_SPI_ARDUINO_BACKEND