| 12345678910111213141516171819202122232425262728 |
- #include "systick.h"
- #include "includes.h"
- void SysTick_init(void)
- {
- RCC_ClocksTypeDef RCC_Clocks;
- RCC_GetClocksFreq(&RCC_Clocks);
- SysTick_Config(RCC_Clocks.SYSCLK_Frequency / OS_CFG_TICK_RATE_HZ);
- //SystemCoreClock
- // SysTick->CTRL |= SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk;
- // NVIC_EnableIRQ(SysTick_IRQn);
- }
- /**
- * @brief This function handles SysTick Handler.
- * @param None
- * @retval None
- */
- volatile uint32_t TickCounter;
- volatile uint64_t TickCounter_u64;
- void SysTick_Handler(void)
- {
- OSIntEnter();
- OSTimeTick();
- OSIntExit();
- TickCounter++;
- TickCounter_u64++;
- }
|