-
AT32F421定时器3和15启用中断就进入Infinite_Loop
/*********************************************************************************File:main.c*Version:V1.2.4*******************************************************************************//*Includes------------------------------------------------------------------*/#include"at32f4xx.h"#include"at32_board.h"/*Privatetypedef-----------------------------------------------------------*//*Privatedefine------------------------------------------------------------*//*Privatemacro-------------------------------------------------------------*//*Privatevariables---------------------------------------------------------*/GPIO_InitTypeGPIO_InitStructure;TMR_TimerBaseInitTypeTMR_TMReBaseStructure={0};TMR_OCInitTypeTMR_OCInitStructure={0};NVIC_InitTypeNVIC_InitStructure;/*Privatefunctionprototypes-----------------------------------------------*/voidRCC_Configuration(void);voidAT32_NVIC_Init(void);voidAT32_TMR3_Init(void);/*Privatefunctions---------------------------------------------------------*/intmain(void){AT32_NVIC_Init();RCC_Configuration();Delay_init();AT32_LEDn_Init(LED3);AT32_LEDn_OFF(LED3);AT32_TMR3_Init();TMR_INTConfig(TMR3,TMR_INT_CC1,ENABLE);TMR_Cmd(TMR3,ENABLE);/*TMR3enablecounter*/while(1){Delay_ms(100);}}voidRCC_Configuration(void){RCC_APB1PeriphClockCmd(RCC_APB1PERIPH_TMR3,ENABLE);RCC_APB2PeriphClockCmd(RCC_APB2PERIPH_TMR1,ENABLE);}voidAT32_NVIC_Init(void){//NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);NVIC_InitStructure.NVIC_IRQChannel=TMR3_GLOBAL_IRQn;NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=1;NVIC_InitStructure.NVIC_IRQChannelSubPriority=1;NVIC_InitStructu
2021-10-02 1