other/*: Random coding-style fixes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user