From 9532195e65edcec7d2f55dbb71f00bb18a04dac8 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Mon, 6 Feb 2012 23:39:06 +0100 Subject: More coding-style and cosmetic fixes. --- examples/stm32/f2/jobygps/miniblink/miniblink.c | 9 +++------ examples/stm32/f2/jobygps/spi_test/spi_test.c | 7 +++---- examples/stm32/f2/jobygps/usart_printf/usart_printf.c | 10 +++++----- 3 files changed, 11 insertions(+), 15 deletions(-) (limited to 'examples') diff --git a/examples/stm32/f2/jobygps/miniblink/miniblink.c b/examples/stm32/f2/jobygps/miniblink/miniblink.c index 0e9b017..9b31d15 100644 --- a/examples/stm32/f2/jobygps/miniblink/miniblink.c +++ b/examples/stm32/f2/jobygps/miniblink/miniblink.c @@ -24,11 +24,9 @@ void gpio_setup(void) { /* Enable GPIOC clock. */ - /* Using API functions: */ rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPCEN); /* Set GPIO3 and GPIO4 (in GPIO port C) to 'output push-pull'. */ - /* Using API functions: */ gpio_mode_setup(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO3 | GPIO4); } @@ -38,12 +36,11 @@ int main(void) gpio_setup(); - gpio_set(GPIOC, GPIO3); - gpio_clear(GPIOC, GPIO4); + gpio_set(GPIOC, GPIO3); + gpio_clear(GPIOC, GPIO4); /* Blink the LEDs (PC3, PC4) on the board. */ - while (1) - { + while (1) { /* Using API function gpio_toggle(): */ gpio_toggle(GPIOC, GPIO3); gpio_toggle(GPIOC, GPIO4); diff --git a/examples/stm32/f2/jobygps/spi_test/spi_test.c b/examples/stm32/f2/jobygps/spi_test/spi_test.c index e5c9539..2d6ab00 100644 --- a/examples/stm32/f2/jobygps/spi_test/spi_test.c +++ b/examples/stm32/f2/jobygps/spi_test/spi_test.c @@ -28,12 +28,11 @@ void clock_setup(void) { - /* Enable clocks on all the peripherals we are going to use. */ + /* 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); + rcc_peripheral_enable_clock(&RCC_AHB1ENR, + RCC_AHB1ENR_IOPCEN | RCC_AHB1ENR_IOPAEN | RCC_AHB1ENR_IOPBEN); } void spi_setup(void) diff --git a/examples/stm32/f2/jobygps/usart_printf/usart_printf.c b/examples/stm32/f2/jobygps/usart_printf/usart_printf.c index 30957a3..26bd007 100644 --- a/examples/stm32/f2/jobygps/usart_printf/usart_printf.c +++ b/examples/stm32/f2/jobygps/usart_printf/usart_printf.c @@ -18,19 +18,19 @@ * along with this program. If not, see . */ +#include +#include #include #include #include #include -#include -#include - void clock_setup(void) { - /* Enable clocks on all the peripherals we are going to use. */ + /* Enable clocks on all the peripherals we are going to use. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART1EN); - rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPCEN | RCC_AHB1ENR_IOPAEN); + rcc_peripheral_enable_clock(&RCC_AHB1ENR, + RCC_AHB1ENR_IOPCEN | RCC_AHB1ENR_IOPAEN); } void usart_setup(void) -- cgit v1.2.3