Fix RP2040 SPISettings (#3960)

This commit is contained in:
Jesse Hills 2022-10-28 12:33:15 +13:00 committed by GitHub
parent 0e30c49e3f
commit bf4d3df906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -225,7 +225,11 @@ class SPIComponent : public Component {
} else if (CLOCK_POLARITY && CLOCK_PHASE) { } else if (CLOCK_POLARITY && CLOCK_PHASE) {
data_mode = SPI_MODE3; data_mode = SPI_MODE3;
} }
#ifdef USE_RP2040
SPISettings settings(DATA_RATE, static_cast<BitOrder>(BIT_ORDER), data_mode);
#else
SPISettings settings(DATA_RATE, BIT_ORDER, data_mode); SPISettings settings(DATA_RATE, BIT_ORDER, data_mode);
#endif
this->hw_spi_->beginTransaction(settings); this->hw_spi_->beginTransaction(settings);
} else { } else {
#endif // USE_SPI_ARDUINO_BACKEND #endif // USE_SPI_ARDUINO_BACKEND