aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorUwe Hermann2011-11-12 10:10:32 +0100
committerUwe Hermann2011-11-12 17:53:01 +0100
commitf23d9d07b7651afe859db64e64e2af04e574bcec (patch)
tree13bf8b7be047192af5b38e2cdd59f7ecffcbaad8 /examples
parent99f4ca3b222e9096c609a5a7770a48d7f1151437 (diff)
lisa-m/fancyblink: Fix copy-pasted code comments.
Diffstat (limited to 'examples')
-rw-r--r--examples/stm32/f1/lisa-m/fancyblink/fancyblink.c15
1 files changed, 8 insertions, 7 deletions
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 */