\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
| 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 |
no test coverage detected