stc_bt_config_t stcConfig;
en_result_t en_result = Error;
uint32_t u32InitCntData = 0xffff0000;
DDL_ZERO_STRUCT(stcConfig);
/* 对外部exit0计数 gpio配置 */
Gpio_SetFunc_TIM0_EXT_P34();
stcConfig.enGateP = BtPositive;
stcConfig.enGate = BtGateDisable;
stcConfig.enPRS = BtPCLKDiv8;
stcConfig.enTog = BtTogDisable;
stcConfig.enCT = BtTimer; /* 定时器模式 */
stcConfig.enMD = BtMode2; /* 16位自动重装 */
stcConfig.pfnTim0Cb = cola_timer_ticker;
if(Ok != Bt_Init(TIM0, &stcConfig))
{
en_result = Error;
}
/* irq enable */
Bt_ClearIntFlag(TIM0);
EnableNvic(TIM0_IRQn, 3, TRUE);
Bt_EnableIrq(TIM0);
/* 1s/(24M/8分频/3) = 1us */
Bt_ARRSet(TIM0, 3 -1);
Bt_Cnt16Set(TIM0, 1000-1);/* 1us*1000 = 1ms定时器中断 */
Bt_Run(TIM0);
我这样配置为什么进入不了定时器中断?第一次用这个单片机,求大佬解答下 |