aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/f2/jobygps/spi_test/spi_test.c
diff options
context:
space:
mode:
authorFergus Noble2012-01-25 23:11:46 -0800
committerUwe Hermann2012-02-06 23:08:07 +0100
commitd071a9ffde5160a0f6cdaa2fe8f991ba9b5f9226 (patch)
treeff676766880eec69b38b053a1db3e8016f4248c8 /examples/stm32/f2/jobygps/spi_test/spi_test.c
parentac29b654a992a4855626fc0b92874d3847914f85 (diff)
Cleaned up the jobygps examples.
Diffstat (limited to 'examples/stm32/f2/jobygps/spi_test/spi_test.c')
-rw-r--r--examples/stm32/f2/jobygps/spi_test/spi_test.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/stm32/f2/jobygps/spi_test/spi_test.c b/examples/stm32/f2/jobygps/spi_test/spi_test.c
index 0f3d0ed..e5c9539 100644
--- a/examples/stm32/f2/jobygps/spi_test/spi_test.c
+++ b/examples/stm32/f2/jobygps/spi_test/spi_test.c
@@ -28,13 +28,12 @@
void clock_setup(void)
{
-
-#warning "This code has to call some kind of rcc clock setup function!!!"
-
- RCC_APB1ENR |= RCC_APB1ENR_SPI2EN;
- RCC_APB2ENR |= RCC_APB2ENR_USART1EN;
- RCC_AHB1ENR |=
- RCC_AHB1ENR_IOPCEN | RCC_AHB1ENR_IOPAEN | RCC_AHB1ENR_IOPBEN;
+ /* Enable clocks on all the peripherals we are going to use. */
+ rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_SPI2EN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART1EN);
+ rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPCEN | \
+ RCC_AHB1ENR_IOPAEN | \
+ RCC_AHB1ENR_IOPBEN);
}
void spi_setup(void)