基础知识,本人学习记录,仅供参考。
系统rt_tick大小定义在rtconfig.h中:
/* Tick per Second */
#define RT_TICK_PER_SECOND 100
默认大小为100/秒,即10ms
时钟采用SysTick定时,初始化在startup.c文件中:
rtthread_startup() -> rt_hw_board_init() -> SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
SysTick中断处理函数在board.c中:
SysTick_Handler();
在SysTick_Handler();中对tick进行计数的函数为:
rt_tick_increase();
rt_tick随着系统运行不断增加
跟进去分析下rt_tick_increase();函数:
1 /** 2 * This function will