一道C改错题,大侠帮忙看看!
unsigned char gSendChar = FALSE;unsigned char gNextChar = 0U;
#pragma interrupt=UART_TX_ISR
__interrupt void uart_tx_isr(void)
{
if(gSendChar)
UART_TX_REG = gNextChar;
gSendChar = FALSE;
}
void uart_write(unsigned char c)
{
if(!gSendChar)
{
gSendChar = TRUE;
gNextChar = c;
}
}