1、ucos ii相关文件移植
2、删除stm32f10x_it.c中的PendSV_Handler函数
3、修改stm32f10x_it.c中的SysTick_Handler函数
void SysTick_Handler(void)
{
OSIntEnter();
OSTimeTick();
OSIntExit();
}
4、在初始化时配置ucos的systick和时间片
static void systick_init(void)
{
RCC_ClocksTypeDef rcc_clocks;
RCC_GetClocksFreq(&rcc_clocks);
SysTick_Config(rcc_clocks.HCLK_Frequency / OS_TICKS_PER_SEC);
}
5、使用微库编译,否则可能ram不够。