看我们的吧:
//系统时钟中断服务函数
void SysTick_Handler(void)
{
OS_ENTER_CRITICAL(); /* Tell uC/OS-II that we are starting an ISR */
OSIntNesting++;
OS_EXIT_CRITICAL();
OSTimeTick(); /* Call uC/OS-II's OSTimeTick() */
OSIntExit(); /* Tell uC/OS-II that we are leaving the ISR */
}
//系统时钟配置,设计1ms产生一次中断
void SysTick_Configuration(void)
{
SysTick->CTRL&=~(1<<2);//SYSTICK使用外部时钟源
SysTick->CTRL|=1<<1; //开启SYSTICK中断
SysTick->LOAD=9000; //产生1ms中断
//bit2清空,选择外部时钟 HCLK/8
MY_NVIC_Init(3,3,SystemHandler_SysTick,2);//组2,最低优先级
SysTick->CTRL|=1<<0; //开启SYSTICK
}
呵呵
看我们的吧:
//系统时钟中断服务函数
void SysTick_Handler(void)
{
OS_ENTER_CRITICAL(); /* Tell uC/OS-II that we are starting an ISR */
OSIntNesting++;
OS_EXIT_CRITICAL();
OSTimeTick(); /* Call uC/OS-II's OSTimeTick() */
OSIntExit(); /* Tell uC/OS-II that we are leaving the ISR */
}
//系统时钟配置,设计1ms产生一次中断
void SysTick_Configuration(void)
{
SysTick->CTRL&=~(1<<2);//SYSTICK使用外部时钟源
SysTick->CTRL|=1<<1; //开启SYSTICK中断
SysTick->LOAD=9000; //产生1ms中断
//bit2清空,选择外部时钟 HCLK/8
MY_NVIC_Init(3,3,SystemHandler_SysTick,2);//组2,最低优先级
SysTick->CTRL|=1<<0; //开启SYSTICK
}
呵呵
举报