aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/f1/other/systick/systick.c
diff options
context:
space:
mode:
authorUwe Hermann2011-11-13 09:13:27 +0100
committerUwe Hermann2011-11-13 23:16:13 +0100
commit7f1e75c3a8f7bd4accdbf88a127b24d87131e617 (patch)
treee9110819b1d970d65be74ea2edc269891f74ee8a /examples/stm32/f1/other/systick/systick.c
parent8a77630997a6f8e4cb543528d5c1c63b060fd7de (diff)
other/*: Random coding-style fixes.
Diffstat (limited to 'examples/stm32/f1/other/systick/systick.c')
-rw-r--r--examples/stm32/f1/other/systick/systick.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/stm32/f1/other/systick/systick.c b/examples/stm32/f1/other/systick/systick.c
index 173ff2a..2422d6e 100644
--- a/examples/stm32/f1/other/systick/systick.c
+++ b/examples/stm32/f1/other/systick/systick.c
@@ -37,11 +37,11 @@ void gpio_setup(void)
GPIO_CNF_OUTPUT_PUSHPULL, GPIO7);
}
-void sys_tick_handler()
+void sys_tick_handler(void)
{
temp32++;
-
- /* we call this handler every 1ms so 1000ms = 1s on/off */
+
+ /* We call this handler every 1ms so 1000ms = 1s on/off. */
if (temp32 == 1000) {
gpio_toggle(GPIOB, GPIO6); /* LED2 on/off */
temp32 = 0;
@@ -50,26 +50,26 @@ void sys_tick_handler()
int main(void)
{
- rcc_clock_setup_in_hse_16mhz_out_72mhz();
+ rcc_clock_setup_in_hse_16mhz_out_72mhz();
gpio_setup();
gpio_clear(GPIOB, GPIO7); /* LED1 on */
gpio_set(GPIOB, GPIO6); /* LED2 off */
-
+
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);
systick_interrupt_enable();
- /* start counting */
+ /* Start counting. */
systick_counter_enable();
-
- while(1); /* Halt. */
+
+ while (1); /* Halt. */
return 0;
}