From f23d9d07b7651afe859db64e64e2af04e574bcec Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 12 Nov 2011 10:10:32 +0100 Subject: lisa-m/fancyblink: Fix copy-pasted code comments. --- examples/stm32/f1/lisa-m/fancyblink/fancyblink.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/stm32/f1/lisa-m/fancyblink/fancyblink.c b/examples/stm32/f1/lisa-m/fancyblink/fancyblink.c index 6d5fbe3..8eedd5c 100644 --- a/examples/stm32/f1/lisa-m/fancyblink/fancyblink.c +++ b/examples/stm32/f1/lisa-m/fancyblink/fancyblink.c @@ -26,26 +26,27 @@ void clock_setup(void) { rcc_clock_setup_in_hse_12mhz_out_72mhz(); - /* Enable GPIOC clock. */ + /* Enable GPIOB, GPIOC, and AFIO clocks. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); - } void gpio_setup(void) { - /* Set GPIO12 (in GPIO port C) to 'output push-pull'. */ + /* Set GPIO13 (in GPIO port C) to 'output push-pull'. */ gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO13); + + /* Set GPIO4 (in GPIO port B) to 'output push-pull'. */ gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO4); AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_FULL_SWJ_NO_JNTRST; - /* preconfigure the led's */ - gpio_set(GPIOB, GPIO4); /* switch off led */ - gpio_clear(GPIOC, GPIO13); /* switch on led */ + /* Preconfigure the LEDs. */ + gpio_set(GPIOB, GPIO4); /* Switch off LED. */ + gpio_clear(GPIOC, GPIO13); /* Switch on LED. */ } int main(void) @@ -55,7 +56,7 @@ int main(void) clock_setup(); gpio_setup(); - /* Blink the LED (PC12) on the board. */ + /* Blink the LEDs (PC13 and PB4) on the board. */ while (1) { gpio_toggle(GPIOC, GPIO13); /* LED on/off */ gpio_toggle(GPIOB, GPIO4); /* LED on/off */ -- cgit v1.2.3