diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-11-01 18:05:54 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-11-01 18:05:54 +0000 |
commit | bf464a835d40efa0f766e5602bf0cd566ce48327 (patch) | |
tree | 80225162174c79742ac657304a8c53b146be88a3 /os/io/platforms/STM32 | |
parent | 37182851ef5334fb8e8e42ca9ed500dbc59a85b5 (diff) | |
download | ChibiOS-bf464a835d40efa0f766e5602bf0cd566ce48327.tar.gz ChibiOS-bf464a835d40efa0f766e5602bf0cd566ce48327.tar.bz2 ChibiOS-bf464a835d40efa0f766e5602bf0cd566ce48327.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1262 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io/platforms/STM32')
-rw-r--r-- | os/io/platforms/STM32/stm32_dma.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/os/io/platforms/STM32/stm32_dma.c b/os/io/platforms/STM32/stm32_dma.c index 7368f1bb9..9593a5f51 100644 --- a/os/io/platforms/STM32/stm32_dma.c +++ b/os/io/platforms/STM32/stm32_dma.c @@ -45,11 +45,8 @@ static cnt_t dmacnt2; void dmaInit(void) {
dmacnt1 = 0;
- DMA1->IFCR = 0x0FFFFFFF;
-
#if defined(STM32F10X_HD) || defined (STM32F10X_CL)
dmacnt2 = 0;
- DMA2->IFCR = 0x0FFFFFFF;
#endif
}
@@ -62,13 +59,17 @@ void dmaEnable(uint32_t dma) { switch (dma) {
case DMA1_ID:
- if (dmacnt1++ == 0)
+ if (dmacnt1++ == 0) {
RCC->AHBENR |= RCC_AHBENR_DMA1EN;
+ DMA1->IFCR = 0x0FFFFFFF;
+ }
break;
#if defined(STM32F10X_HD) || defined (STM32F10X_CL)
case DMA2_ID:
- if (dmacnt2++ == 0)
+ if (dmacnt2++ == 0) {
RCC->AHBENR |= RCC_AHBENR_DMA2EN;
+ DMA2->IFCR = 0x0FFFFFFF;
+ }
break;
#endif
}
|