void UART2_SendByte(u8 data) { UART2_SendData8((unsigned char)data); /* 等待传输结束 */ while (UART2_GetFlagStatus(UART2_FLAG_TXE) == RESET); }
@far @interrupt void UART2_RX_IRQHandler(void) { u8 c; if (UART2_GetFlagStatus(UART2_FLAG_RXNE) != RESET) { /* Read one byte from the receive data register */ c = UART2_ReceiveData8(); CharDecode( c ); } }
@far @interrupt void UART2_RX_IRQHandler(void) { u8 c; if (UART2_GetFlagStatus(UART2_FLAG_RXNE) != RESET) { /* Read one byte from the receive data register */ c = UART2_ReceiveData8(); if (EncodeNMEA( c )) { // process new gps info here } } }