void NVIC_Configuration(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
//#ifdef VECT_TAB_RAM
// /* Set the Vector Table base location at 0x20000000 */
// NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0); //设置中断向量在RAM中
////#elif defined(VECT_TAB_FLASH_IAP)
//// NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x2000);
//#else /* VECT_TAB_FLASH */
// /* Set the Vector Table base location at 0x08000000 */
// NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0); //设置中断向量在FLASH中
//#endif
//
/* Configure the NVIC Preemption Priority Bits */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
/* Enable the USART2 Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
加了这个函数,程序运行到这个函数就没有卡住了
注:我是使用串口2,发送接受数据都正常,加了这个函数之后后面的函数就没有运行了,求各位大侠的解释?
查了一下资料,有人说是添加stm32f10x_vector这个文件进入工程,不知道是什么原因? |