diff options
Diffstat (limited to 'testhal/STM32/multi/SPI/main.c')
-rwxr-xr-x | testhal/STM32/multi/SPI/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/testhal/STM32/multi/SPI/main.c b/testhal/STM32/multi/SPI/main.c index fd1d74250..f41e17fc0 100755 --- a/testhal/STM32/multi/SPI/main.c +++ b/testhal/STM32/multi/SPI/main.c @@ -41,6 +41,8 @@ static THD_FUNCTION(spi_thread_1, p) { spiExchange(&PORTAB_SPI1, 512,
txbuf, rxbuf); /* Atomic transfer operations. */
spiUnselect(&PORTAB_SPI1); /* Slave Select de-assertion. */
+ dmaBufferInvalidate(&txbuf[0], /* Cache invalidation over the */
+ sizeof txbuf); /* buffer. */
spiReleaseBus(&PORTAB_SPI1); /* Ownership release. */
}
}
@@ -61,6 +63,8 @@ static THD_FUNCTION(spi_thread_2, p) { spiExchange(&PORTAB_SPI1, 512,
txbuf, rxbuf); /* Atomic transfer operations. */
spiUnselect(&PORTAB_SPI1); /* Slave Select de-assertion. */
+ dmaBufferInvalidate(&txbuf[0], /* Cache invalidation over the */
+ sizeof txbuf); /* buffer. */
spiReleaseBus(&PORTAB_SPI1); /* Ownership release. */
}
}
@@ -107,6 +111,7 @@ int main(void) { */
for (i = 0; i < sizeof(txbuf); i++)
txbuf[i] = (uint8_t)i;
+ dmaBufferFlush(&txbuf[0], sizeof txbuf);
/*
* Starting the transmitter and receiver threads.
|