We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8a10069 + 6987d3d commit 4e169bbCopy full SHA for 4e169bb
ports/atmel-samd/common-hal/busio/SPI.c
@@ -268,7 +268,14 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self,
268
}
269
int32_t status;
270
if (len >= 16) {
271
- status = sercom_dma_write(self->spi_desc.dev.prvt, data, len);
+ size_t bytes_remaining = len;
272
+
273
+ // Maximum DMA transfer is 65535
274
+ while (bytes_remaining > 0) {
275
+ size_t to_send = (bytes_remaining > 65535) ? 65535 : bytes_remaining;
276
+ status = sercom_dma_write(self->spi_desc.dev.prvt, data + (len - bytes_remaining), to_send);
277
+ bytes_remaining -= to_send;
278
+ }
279
} else {
280
struct io_descriptor *spi_io;
281
spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io);
0 commit comments