mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-03 19:38:30 +02:00
Fix SPI inverted clock on ESP8266 (#5416)
This commit is contained in:
committed by
Jesse Hills
parent
55e36ab982
commit
b07a038bc8
@@ -15,6 +15,11 @@ class SPIDelegateHw : public SPIDelegate {
|
||||
void begin_transaction() override {
|
||||
#ifdef USE_RP2040
|
||||
SPISettings const settings(this->data_rate_, static_cast<BitOrder>(this->bit_order_), this->mode_);
|
||||
#elif defined(ESP8266)
|
||||
// Arduino ESP8266 library has mangled values for SPI modes :-(
|
||||
auto mode = (this->mode_ & 0x01) + ((this->mode_ & 0x02) << 3);
|
||||
ESP_LOGV(TAG, "8266 mangled SPI mode 0x%X", mode);
|
||||
SPISettings const settings(this->data_rate_, this->bit_order_, mode);
|
||||
#else
|
||||
SPISettings const settings(this->data_rate_, this->bit_order_, this->mode_);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user