fix(driver_spi): fixed slave example error on esp32p4

This commit is contained in:
wanckl
2024-11-28 11:21:19 +08:00
parent fcdc5d02d4
commit 0610fa3460
4 changed files with 14 additions and 13 deletions

View File

@@ -96,11 +96,10 @@ void app_main(void)
ret = spi_slave_initialize(RCV_HOST, &buscfg, &slvcfg, SPI_DMA_CH_AUTO);
assert(ret == ESP_OK);
WORD_ALIGNED_ATTR char sendbuf[129] = "";
WORD_ALIGNED_ATTR char recvbuf[129] = "";
memset(recvbuf, 0, 33);
spi_slave_transaction_t t;
memset(&t, 0, sizeof(t));
char *sendbuf = spi_bus_dma_memory_alloc(RCV_HOST, 129, 0);
char *recvbuf = spi_bus_dma_memory_alloc(RCV_HOST, 129, 0);
assert(sendbuf && recvbuf);
spi_slave_transaction_t t = {0};
while (1) {
//Clear receive buffer, set send buffer to something sane