Hi Leute, wenn ich den system tick timer auf meinem Cortex starten möchte, dann rufe ich doch nur einmal in meiner main() Methode die Methode SysTick_Config(72000000) auf,
1 | /** \brief System Tick Configuration
|
2 | |
3 | This function initialises the system tick timer and its interrupt and start the system tick timer.
|
4 | Counter is in free running mode to generate periodical interrupts.
|
5 | |
6 | \param [in] ticks Number of ticks between two interrupts
|
7 | \return 0 Function succeeded
|
8 | \return 1 Function failed
|
9 | */
|
10 | static __INLINE uint32_t SysTick_Config(uint32_t ticks) |
11 | {
|
12 | if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */ |
13 | |
14 | SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */ |
15 | NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */ |
16 | SysTick->VAL = 0; /* Load the SysTick Counter Value */ |
17 | SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | |
18 | SysTick_CTRL_TICKINT_Msk | |
19 | SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ |
20 | return (0); /* Function successful */ |
21 | }
|
und schreiben dann in meinen Händler:
[c]
void SysTick_Handler(void)
{
outpin_toggle(&led_4);
}
und schon müsste doch eine LED jede Sekunde getoggelt werden?
Oder hab ich irgendwas wichtiges vergessen, da meine LED nicht
reagiert....