EXTI_Init(&EXTI_InitStructure);
//将USART3的TXD和RXD重映射到PC10和pc11
//GPIO_PinRemapConfig(GPIO_PartialRemap_USART3,ENABLE);
}
//void EXTI_Configuration(void)
//{
// EXTI_InitTypeDef EXTI_InitStructure;
// EXTI_DeInit(); //将EXIT寄存器重设置为缺省值
// EXTI_InitStructure.EXTI_Line = EXTI_Line13;
// EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
// EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
// EXTI_InitStructure.EXTI_LineCmd = ENABLE;
// EXTI_Init(&EXTI_InitStructure);
//
// EXTI_ClearITPendingBit(EXTI_Line13);
//}
void NVIC_Configuration(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
#ifdef VECT_TAB_RAM
NVIC_SetVectorTable(NVIC_VectTab_RAM,0X0);//向量表位于RAM区
#else
NVIC_SetVectorTable(NVIC_VectTab_FLASH,0X0);//向量表位于FLASH区
#endif
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
//
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQChannel;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
//void USART3_Configuration(void)
//{
// USART_InitTypeDefU3;
// U3.USART_BaudRate =9600;
// U3.USART_WordLength = USART_WordLength_8b;
// U3.USART_StopBits = USART_StopBits_1;
// U3.USART_Parity = USART_Parity_No;
// U3.USART_Mode = USART_Mode_Rx|USART_Mode_Tx;
// U3.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
//
// USART_Init(USART3, &U3);
//
// USART_Cmd(USART3,ENABLE);
//}
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-47385-4.html
完全正确
记得当时是先警告美舰