예제 #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
파일: main.c 프로젝트: KNVRK/STM8SProjects
@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
파일: main.c 프로젝트: KNVRK/STM8SProjects
@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
		}
	}
}