在线时间4 小时
UID2104065
注册时间2014-6-27
NXP金币0
该用户从未签到
新手上路

- 积分
- 19
- 最后登录
- 1970-1-1
|
各位好!
最近正在用蓝宙的S32K144开发板,用的S32DS开发环境,仿真器J-Link。设置了一个定时器中断遇到一点问题,请教给位高手!
用PE配置的overflow定时器,Debug的时候发现,定时器已经循环计数,中断标志也置起了,但是程序不进中断服务函数。
下面是代码,前一段是main,后一段是中断服务函数。
int main(void)
{
ftm_state_t ftmStateStruct;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of Processor Expert internal initialization. ***/
/* Write your code here */
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr,
CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
GPIO_HAL_SetPinsDirection(PTB,((1 << 4U)|(1 << 5U)));
FTM_DRV_Init(INST_FLEXTIMER1, &flexTimer1_InitConfig, &ftmStateStruct);
INT_SYS_InstallHandler(FTM0_Ovf_Reload_IRQn, &ftmTimerISR, (isr_t*) 0);
INT_SYS_EnableIRQ(FTM0_Ovf_Reload_IRQn);
FTM_DRV_InitCounter(INST_FLEXTIMER1, &flexTimer1_TimerConfig);
FTM_DRV_CounterStart(INST_FLEXTIMER1);
GPIO_HAL_SetPins(PTB,(1 << 4U));
GPIO_HAL_ClearPins(PTB,(1 << 5U));
while(1)
{
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;) {
if(exit_code != 0) {
break;
}
}
return exit_code;
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END main */
/* Flex Timer Instance interrupt service routine*/
void ftmTimerISR(void)
{
static uint8_t s_overflowCount = 0U;
if(s_overflowCount < 10U)
{
s_overflowCount++;
}
else
{
GPIO_HAL_TogglePins(PTB , ((1 << 4U)|(1 << 5U)));
s_overflowCount = 0U;
}
/* Clear FTM Timer Overflow flag */
FTM_HAL_ClearTimerOverflow(g_ftmBase[INST_FLEXTIMER1]);
}
请各位赐教,谢谢!
|
|