diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2015-08-13 09:57:10 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2015-08-13 09:57:10 +0000 |
commit | d8b4ba3e592d490fb1572a07b6c48d7ba6c02687 (patch) | |
tree | ba765697f2a0c3c89e146fba8230676ef571cac9 /testhal | |
parent | 82ed9f3093c6eee305364314d891f73d64507ce0 (diff) | |
download | ChibiOS-d8b4ba3e592d490fb1572a07b6c48d7ba6c02687.tar.gz ChibiOS-d8b4ba3e592d490fb1572a07b6c48d7ba6c02687.tar.bz2 ChibiOS-d8b4ba3e592d490fb1572a07b6c48d7ba6c02687.zip |
Added cache handling to DMAv2 driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8209 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c b/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c index a71d2540f..0ff6372bf 100644 --- a/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c +++ b/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c @@ -47,6 +47,11 @@ size_t nx = 0, ny = 0; static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
(void)adcp;
+
+ /* DMA buffer invalidation because data cache.*/
+ dmaBufferInvalidate(buffer, n * ADC_GRP1_NUM_CHANNELS);
+
+ /* Updating counters.*/
if (samples1 == buffer) {
nx += n;
}
@@ -111,11 +116,6 @@ static THD_FUNCTION(Thread1, arg) { */
int main(void) {
- SCB_InvalidateICache();
- SCB_EnableICache();
- SCB_InvalidateDCache();
- SCB_EnableDCache();
-
/*
* System initializations.
* - HAL initialization, this also initializes the configured device drivers
@@ -126,6 +126,11 @@ int main(void) { halInit();
chSysInit();
+ SCB_InvalidateICache();
+ SCB_EnableICache();
+ SCB_InvalidateDCache();
+ SCB_EnableDCache();
+
/*
* Activates the serial driver 1 using the driver default configuration.
*/
|