stm32f030c8t6工程有個a文件,沒見到串口中斷,往工程中添加usart中斷后,編譯說重複定義,沒明白為什麼這樣?
void USART2_IRQHandler(void)
{
if(USART_GetFlagStatus(USART2, USART_FLAG_RXNE)!=RESET)
{
UartRxData[UartRxDatacount++]=(USART_ReceiveData(USART2));
if(UartRxDatacount>5)
{
UartRxDatacount =0;
USART_ITConfig(USART2, USART_IT_RXNE, DISABLE);
USART_ITConfig(USART2, USART_IT_TC, ENABLE);
}
}
GPIO_ResetBits(GPIOA, GPIO_Pin_9);
if(USART_GetFlagStatus(USART2, USART_FLAG_TC) != RESET)
{
USART_ClearFlag(USART2,USART_FLAG_TC);
// USART_SendData(USART2, TDR_Data[TDR_Datacount++]);
TDR_Data[TDR_Datacount++] =USART2->TDR;
if(TDR_Datacount>5)
{
TDR_Datacount = 0;
USART_ITConfig(USART2, USART_IT_TC, DISABLE);
USART_ITConfig(USART2, USART_IT_RXNE, ENABLE);
}
}
}
Error[Li006]: duplicate definitions for "USART2_IRQHandler"; in "C:Users
d175DesktopTL 100 V2.1.1113 with _15_01_013 APP V1.43WLT2564J_EWIG_15_01_013EWIG
ProjectsEWARM_DemoIO_ToggleObjmain.o", and "HCITRANS.o(IAR_M0_EWIG.a)"
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
已解決,謝謝
一周热门 更多>