MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / SysTick_Config

Function SysTick_Config

bsp/efm32/Libraries/CMSIS/Include/core_cm3.h:1517–1528  ·  view source on GitHub ↗

\brief System Tick Configuration The function initializes the System Timer and its interrupt, and starts the System Tick Timer. Counter is in free running mode to generate periodic interrupts. \param [in] ticks Number of ticks between two interrupts. \return 0 Function succeeded. \return 1 Function failed. \note When the variable __Vendor_S

Source from the content-addressed store, hash-verified

1515
1516 */
1517__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
1518{
1519 if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
1520
1521 SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */
1522 NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */
1523 SysTick->VAL = 0; /* Load the SysTick Counter Value */
1524 SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
1525 SysTick_CTRL_TICKINT_Msk |
1526 SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
1527 return (0); /* Function successful */
1528}
1529
1530#endif
1531

Callers 1

SysTick_ConfigurationFunction · 0.50

Calls 1

NVIC_SetPriorityFunction · 0.70

Tested by

no test coverage detected