示例#1
0
文件: bsp.c 项目: HorseMa/contiki
void UART2_SendByte(u8 data)
{
  UART2_SendData8((unsigned char)data);
	
  /* 等待传输结束 */
  while (UART2_GetFlagStatus(UART2_FLAG_TXE) == RESET);
}
示例#2
0
@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 );
	}
}
示例#3
0
@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
		}
	}
}