8000 Using DMA SPI transfers results in more than doubled network speed. (#6) · Networking-for-Arduino/ESPHost@80c0fa8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 80c0fa8

Browse files
PontusOPontus Oldberg
andauthored
Using DMA SPI transfers results in more than doubled network speed. (#6)
* Using DMA SPI transfers results in more than doubled network speed for RP2040/RP2350 based boards. * Ensure DMA transfers are not enabled for the Mbed core. --------- Co-authored-by: Pontus Oldberg <pontus.oldberg@non.se.com>
1 parent a3184ba commit 80c0fa8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/EspSpiDriver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,14 @@ int esp_host_send_and_receive(void) {
333333
SPIWIFI.beginTransaction(SPISettings(1000000ul * ESPHOSTSPI_MHZ, MSBFIRST, SPI_MODE2));
334334
digitalWrite(ESP_CS, LOW);
335335
delayMicroseconds(100);
336+
#if defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)
337+
SPIWIFI.transferAsync((const void *)esp32_spi_tx_buffer, (void *)esp32_spi_rx_buffer, MAX_SPI_BUFFER_SIZE);
338+
while (!SPIWIFI.finishedAsync());
339+
#else
336340
for (int i = 0; i < MAX_SPI_BUFFER_SIZE; i++) {
337341
esp32_spi_rx_buffer[i] = SPIWIFI.transfer(esp32_spi_tx_buffer[i]);
338342
}
343+
#endif
339344
digitalWrite(ESP_CS, HIGH);
340345
SPIWIFI.endTransaction();
341346

0 commit comments

Comments
 (0)
0