diff options
author | Erik Gilling <konkers@konkers.net> | 2016-03-02 22:20:53 -0800 |
---|---|---|
committer | Erik Gilling <konkers@konkers.net> | 2016-03-02 22:35:49 -0800 |
commit | f260959150679b32c07a492e24b5a14b15d2fcb0 (patch) | |
tree | fe762d5e02d8d4c236662099c5733747bbfbe7fe /platform | |
parent | 5a9de506a9c8acb5c750db3e7a80c87d923cdaf2 (diff) | |
download | common-f260959150679b32c07a492e24b5a14b15d2fcb0.tar.gz |
[stm32f0xx] Convert dma.c and init.c to new rcc driver.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/stm32f0xx/dma.c | 3 | ||||
-rw-r--r-- | platform/stm32f0xx/init.c | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/platform/stm32f0xx/dma.c b/platform/stm32f0xx/dma.c index d725a1c2..e235b2f4 100644 --- a/platform/stm32f0xx/dma.c +++ b/platform/stm32f0xx/dma.c @@ -27,6 +27,7 @@ #include <arch/arm/cm.h> #include <kernel/event.h> +#include <platform/rcc.h> #include <sys/types.h> #include <stm32f0xx.h> @@ -116,7 +117,7 @@ void dma_wait(dma_channel_t chan) void dma_init(void) { - RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); + stm32_rcc_set_enable(STM32_RCC_CLK_DMA, true); size_t i; for (i = 0; i < countof(dma_events); i++) { diff --git a/platform/stm32f0xx/init.c b/platform/stm32f0xx/init.c index b4ff7ead..5042eaa0 100644 --- a/platform/stm32f0xx/init.c +++ b/platform/stm32f0xx/init.c @@ -27,7 +27,6 @@ #include <platform/stm32.h> #include <platform/dma.h> #include <arch/arm/cm.h> -#include <stm32f0xx_rcc.h> #include "system_stm32f0xx.h" void platform_early_init(void) @@ -36,9 +35,8 @@ void platform_early_init(void) SystemInit(); // start the systick timer - RCC_ClocksTypeDef clocks; - RCC_GetClocksFreq(&clocks); - arm_cm_systick_init(clocks.SYSCLK_Frequency); + // TODO(konkers): get sysclk freq from somewhere. + arm_cm_systick_init(48000000); stm32_timer_early_init(); stm32_gpio_early_init(); |