|
各位 我的 ucos 中断一直进不去
static
void
BSP_IntHandler (CPU_DATA
int_id)
{
#if (CPU_CFG_CRITICAL_METHOD == CPU_CRITICAL_METHOD_STATUS_LOCAL)
CPU_SR
cpu_sr;
#endif
CPU_FNCT_VOID
isr;
CPU_CRITICAL_ENTER();
/* Tell uC/OS-II that we are starting an ISR
*/
OSIntNesting++;
CPU_CRITICAL_EXIT();
if (int_id < BSP_INT_SRC_NBR) {
isr = BSP_IntVectTbl[int_id];
if (isr != (CPU_FNCT_VOID)0) {
isr();
}
}
OSIntExit();
/* Tell uC/OS-II that we are leaving the ISR
*/
}
j-link调试 到了红色的一直不成立 进不了isr();函数.
下面是我的配置.
void time2_Init(void)
{
TIM_TimeBaseInitTypeDef
TIM_TimeBaseStructure;
// TIM_OCInitTypeDef
TIM_OCInitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);
/* enabling interrupt */
NVIC_InitStructure.NVIC_IRQChannel=TIM2_IRQChannel;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
/* Time base configuration */
TIM_TimeBaseStructure.TIM_Period = 8000;
TIM_TimeBaseStructure.TIM_Prescaler =50000;
TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);
TIM_ARRPreloadConfig(TIM2,DISABLE);
/* only counter overflow/underflow generate U interrupt */
TIM_UpdateRequestConfig(TIM2,TIM_UpdateSource_Regular);
/* TIM IT enable */
TIM_ITConfig(TIM2,TIM_IT_Update, ENABLE);
/* TIM2 enable counter */
TIM_Cmd(TIM2, ENABLE);
BSP_IntVectSet (BSP_INT_ID_TIM2,timer_24);
BSP_IntEn (BSP_INT_ID_TIM2);
}
这是中断服务程序
void timer_24(void)
{
if (TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET)
{
TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
BSP_LED_On(0);
OSTaskDel(APP_TASK_KBD_PRIO);
}
}
请各位帮忙看看 .
|
|