From 4cf395d3c97e14e2e4797dc7672d41ade893628e Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 12 Nov 2011 17:49:22 +0100 Subject: obldc examples: Fix comments and coding-style. --- examples/stm32/f1/obldc/can/can.c | 10 ++++----- examples/stm32/f1/obldc/led/led.c | 2 +- examples/stm32/f1/obldc/pwmleds/pwmleds.c | 32 +++++++++++++-------------- examples/stm32/f1/obldc/systick/systick.c | 12 +++++----- examples/stm32/f1/obldc/usart/usart.c | 4 ++-- examples/stm32/f1/obldc/usart_irq/usart_irq.c | 4 ++-- 6 files changed, 32 insertions(+), 32 deletions(-) (limited to 'examples') diff --git a/examples/stm32/f1/obldc/can/can.c b/examples/stm32/f1/obldc/can/can.c index 00a05dc..dd137f1 100644 --- a/examples/stm32/f1/obldc/can/can.c +++ b/examples/stm32/f1/obldc/can/can.c @@ -55,10 +55,10 @@ void gpio_setup(void) /* Enable GPIOB clock. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN); - gpio_set(GPIOA, GPIO6); /* LED0 off */ - gpio_set(GPIOA, GPIO7); /* LED1 off */ - gpio_set(GPIOB, GPIO0); /* LED2 off */ - gpio_set(GPIOB, GPIO1); /* LED3 off */ + gpio_set(GPIOA, GPIO6); /* LED0 off */ + gpio_set(GPIOA, GPIO7); /* LED1 off */ + gpio_set(GPIOB, GPIO0); /* LED2 off */ + gpio_set(GPIOB, GPIO1); /* LED3 off */ /* Set GPIO6/7 (in GPIO port A) to 'output push-pull' for the LEDs. */ gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, @@ -66,7 +66,7 @@ void gpio_setup(void) gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO7); - /* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */ + /* Set GPIO0/1 (in GPIO port B) to 'output push-pull' for the LEDs. */ gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO0); gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ, diff --git a/examples/stm32/f1/obldc/led/led.c b/examples/stm32/f1/obldc/led/led.c index db479b2..f66135a 100644 --- a/examples/stm32/f1/obldc/led/led.c +++ b/examples/stm32/f1/obldc/led/led.c @@ -21,9 +21,9 @@ #include #include -/* Set STM32 to 72 MHz. */ void clock_setup(void) { + /* Set STM32 to 72 MHz. */ rcc_clock_setup_in_hse_8mhz_out_72mhz(); /* Enable GPIOA clock. */ diff --git a/examples/stm32/f1/obldc/pwmleds/pwmleds.c b/examples/stm32/f1/obldc/pwmleds/pwmleds.c index faa9aa0..e55396f 100644 --- a/examples/stm32/f1/obldc/pwmleds/pwmleds.c +++ b/examples/stm32/f1/obldc/pwmleds/pwmleds.c @@ -156,7 +156,7 @@ static const u16 gamma_table_2_2[] = { 49275, 49761, 50249, 50739, 51232, 51728, 52226, 52727, 53230, 53736, 54245, 54756, 55270, 55787, 56306, 56828, 57352, 57879, 58409, 58941, 59476, 60014, 60554, 61097, - 61642, 62190, 62741, 63295, 63851, 64410, 64971, 65535 + 61642, 62190, 62741, 63295, 63851, 64410, 64971, 65535, }; #endif @@ -245,9 +245,9 @@ void clock_setup(void) /* Enable GPIOC, Alternate Function clocks. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, - RCC_APB2ENR_IOPAEN | - RCC_APB2ENR_IOPBEN | - RCC_APB2ENR_AFIOEN); + RCC_APB2ENR_IOPAEN | + RCC_APB2ENR_IOPBEN | + RCC_APB2ENR_AFIOEN); } void gpio_setup(void) @@ -460,18 +460,18 @@ int main(void) if (j == 100) { j = 0; switch (k += kd) { - case 0: - j0 = 255; - break; - case 1: - j1 = 255; - break; - case 2: - j2 = 255; - break; - case 3: - j3 = 255; - break; + case 0: + j0 = 255; + break; + case 1: + j1 = 255; + break; + case 2: + j2 = 255; + break; + case 3: + j3 = 255; + break; } if (k == 3) kd =- 1; diff --git a/examples/stm32/f1/obldc/systick/systick.c b/examples/stm32/f1/obldc/systick/systick.c index 263230f..f011a76 100644 --- a/examples/stm32/f1/obldc/systick/systick.c +++ b/examples/stm32/f1/obldc/systick/systick.c @@ -34,10 +34,10 @@ void gpio_setup(void) /* Enable GPIOB clock. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN); - gpio_set(GPIOA, GPIO6); /* LED0 off */ - gpio_set(GPIOA, GPIO7); /* LED1 off */ - gpio_set(GPIOB, GPIO0); /* LED2 off */ - gpio_set(GPIOB, GPIO1); /* LED3 off */ + gpio_set(GPIOA, GPIO6); /* LED0 off */ + gpio_set(GPIOA, GPIO7); /* LED1 off */ + gpio_set(GPIOB, GPIO0); /* LED2 off */ + gpio_set(GPIOB, GPIO1); /* LED3 off */ /* Set GPIO6/7 (in GPIO port A) to 'output push-pull' for the LEDs. */ gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, @@ -45,7 +45,7 @@ void gpio_setup(void) gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO7); - /* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */ + /* Set GPIO0/1 (in GPIO port B) to 'output push-pull' for the LEDs. */ gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO0); gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ, @@ -74,7 +74,7 @@ int main(void) temp32 = 0; /* 72MHz / 8 => 9000000 counts per second */ - systick_set_clocksource(STK_CTRL_CLKSOURCE_AHB_DIV8); + systick_set_clocksource(STK_CTRL_CLKSOURCE_AHB_DIV8); /* 9000000/9000 = 1000 overflows per second - every 1ms one interrupt */ systick_set_reload(9000); diff --git a/examples/stm32/f1/obldc/usart/usart.c b/examples/stm32/f1/obldc/usart/usart.c index b2efe71..9999f72 100644 --- a/examples/stm32/f1/obldc/usart/usart.c +++ b/examples/stm32/f1/obldc/usart/usart.c @@ -60,7 +60,7 @@ void usart_setup(void) void gpio_setup(void) { - /* Set GPIO12 (in GPIO port C) to 'output push-pull'. */ + /* Set GPIO6 (in GPIO port A) to 'output push-pull'. */ gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO6); } @@ -73,7 +73,7 @@ int main(void) gpio_setup(); usart_setup(); - /* Blink the LED (PC12) on the board with every transmitted byte. */ + /* Blink the LED (PA6) on the board with every transmitted byte. */ while (1) { gpio_toggle(GPIOA, GPIO6); /* LED on/off */ usart_send_blocking(USART1, c + '0'); /* Send a byte. */ diff --git a/examples/stm32/f1/obldc/usart_irq/usart_irq.c b/examples/stm32/f1/obldc/usart_irq/usart_irq.c index 20ff0a1..fb59472 100644 --- a/examples/stm32/f1/obldc/usart_irq/usart_irq.c +++ b/examples/stm32/f1/obldc/usart_irq/usart_irq.c @@ -40,7 +40,7 @@ void usart_setup(void) /* Enable the USART1 interrupt. */ nvic_enable_irq(NVIC_USART1_IRQ); - /* enable USART1 pin software remapping */ + /* Enable USART1 pin software remapping. */ AFIO_MAPR |= AFIO_MAPR_USART1_REMAP; /* Setup GPIO pin GPIO_USART1_RE_TX on GPIO port B for transmit. */ @@ -70,7 +70,7 @@ void gpio_setup(void) { gpio_set(GPIOA, GPIO6 | GPIO7); - /* Setup GPIO6 and 7 (in GPIO port A) for led use. */ + /* Setup GPIO6 and 7 (in GPIO port A) for LED use. */ gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO6 | GPIO7); } -- cgit v1.2.3