Skip to content

Commit

Permalink
fix spi timing issues (#3763)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHR committed Sep 14, 2022
1 parent 6236db1 commit f1e8cc2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions esphome/components/spi/spi.h
Expand Up @@ -195,6 +195,11 @@ class SPIComponent : public Component {

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, uint32_t DATA_RATE>
void enable(GPIOPin *cs) {
if (cs != nullptr) {
this->active_cs_ = cs;
this->active_cs_->digital_write(false);
}

#ifdef USE_SPI_ARDUINO_BACKEND
if (this->hw_spi_ != nullptr) {
uint8_t data_mode = SPI_MODE0;
Expand All @@ -215,11 +220,6 @@ class SPIComponent : public Component {
#ifdef USE_SPI_ARDUINO_BACKEND
}
#endif // USE_SPI_ARDUINO_BACKEND

if (cs != nullptr) {
this->active_cs_ = cs;
this->active_cs_->digital_write(false);
}
}

void disable();
Expand Down

0 comments on commit f1e8cc2

Please sign in to comment.