Skip to content

Commit

Permalink
Remove unnecessary delays
Browse files Browse the repository at this point in the history
  • Loading branch information
LennartF22 committed Sep 24, 2024
1 parent ec47e89 commit 992e174
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/CMT2300a/cmt_spi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ void cmt_spi3_init(const int8_t pin_sdio, const int8_t pin_clk, const int8_t pin
.post_cb = NULL,
};
ESP_ERROR_CHECK(spi_bus_add_device(SPI_CMT, &devcfg2, &spi_fifo));

delay(100);
}

void cmt_spi3_write(const uint8_t addr, const uint8_t data)
Expand All @@ -77,7 +75,6 @@ void cmt_spi3_write(const uint8_t addr, const uint8_t data)
SPI_PARAM_LOCK();
ESP_ERROR_CHECK(spi_device_polling_transmit(spi_reg, &t));
SPI_PARAM_UNLOCK();
delayMicroseconds(100);
}

uint8_t cmt_spi3_read(const uint8_t addr)
Expand All @@ -93,7 +90,6 @@ uint8_t cmt_spi3_read(const uint8_t addr)
SPI_PARAM_LOCK();
ESP_ERROR_CHECK(spi_device_polling_transmit(spi_reg, &t));
SPI_PARAM_UNLOCK();
delayMicroseconds(100);
return data;
}

Expand All @@ -108,7 +104,6 @@ void cmt_spi3_write_fifo(const uint8_t* buf, const uint16_t len)
for (uint8_t i = 0; i < len; i++) {
t.tx_buffer = buf + i;
ESP_ERROR_CHECK(spi_device_polling_transmit(spi_fifo, &t));
delayMicroseconds(4); // > 4 us
}
SPI_PARAM_UNLOCK();
}
Expand All @@ -124,7 +119,6 @@ void cmt_spi3_read_fifo(uint8_t* buf, const uint16_t len)
for (uint8_t i = 0; i < len; i++) {
t.rx_buffer = buf + i;
ESP_ERROR_CHECK(spi_device_polling_transmit(spi_fifo, &t));
delayMicroseconds(4); // > 4 us
}
SPI_PARAM_UNLOCK();
}

0 comments on commit 992e174

Please sign in to comment.