初级会员

- 积分
- 97
- 金钱
- 97
- 注册时间
- 2013-12-20
- 在线时间
- 0 小时
|

楼主 |
发表于 2013-12-21 15:39:33
|
显示全部楼层
void USART1_IRQHandler(void)
{
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
{
/* Read one byte from the receive data register */
RxBuffer1[RxCounter1++] = USART_ReceiveData(USART1);
if(RxCounter1 == NbrOfDataToRead1)
{
/* Disable the USART1 Receive interrupt */
USART_ITConfig(USART1, USART_IT_RXNE, DISABLE);
}
}
if(USART_GetITStatus(USART1, USART_IT_TXE) != RESET)
{
/* Write one byte to the transmit data register */
USART_SendData(USART1, TxBuffer1[TxCounter1++]);
if(TxCounter1 == NbrOfDataToTransfer1)
{
/* Disable the USART1 Transmit interrupt */
USART_ITConfig(USART1, USART_IT_TXE, DISABLE);
}
}
}
/**
* @brief This function handles USART2 global interrupt request.
* @param None
* @retval None
*/
void USART2_IRQHandler(void)
{
if(USART_GetITStatus(USART2, USART_IT_RXNE) != RESET)
{
/* Read one byte from the receive data register */
RxBuffer2[RxCounter2++] = USART_ReceiveData(USART2);
if(RxCounter2 == NbrOfDataToRead1)
{
/* Disable the USART2 Receive interrupt */
USART_ITConfig(USART2, USART_IT_RXNE, DISABLE);
}
}
if(USART_GetITStatus(USART2, USART_IT_TXE) != RESET)
{
/* Write one byte to the transmit data register */
USART_SendData(USART2, TxBuffer2[TxCounter2++]);
if(TxCounter2 == NbrOfDataToTransfer2)
{
/* Disable the USART2 Transmit interrupt */
USART_ITConfig(USART2, USART_IT_TXE, DISABLE);
}
}
}
原子哥,这是官方UART中断函数吗?
我又去翻你的程序,stm32f10x_it.c 文件
里面是没有这俩段的,是被你改成这样的? |
|