zhangbo
4 天以前 64c36ecbd729ba99dcaba24c52512b0edb92a1b5
keil/include/drivers/mk_uart.c
@@ -59,6 +59,22 @@
        .dma_tx_ch = DMA_CH7,
    },
};
uint32_t Serial0KeyPressed(uint8_t *key)
{
    uint32_t status = uart_handle[0].base->STATUS;//已修改为uart0
  if (status & UART_STATUS_DR_MSK)
  {
        //uart_receive(UART_ID1,test_buf,10,NULL);
    *key = (uint8_t)uart_handle[0].base->RX_DATA;//已修改为uart0
        //uart_rx_fifo_clear(UART_ID1);
    return 1;
  }
  else
  {
    return 0;
  }
}
//ÒÆÖ²
uint32_t SerialKeyPressed(uint8_t *key)//ÅжÏÊý¾ÝÊÇ·ñÊÕµ½µÄ MK8000ÐÞ¸Ä
{
@@ -78,7 +94,7 @@
}
void SerialPutChar(uint8_t c)
{
    while (uart_handle[0].base->TX_FL)
    while (uart_handle[1].base->TX_FL)
    {
    }
    uart_send(UART_ID1, &c, 1, NULL);
@@ -95,10 +111,10 @@
void Serial0PutChar(uint8_t c)
{   //ÅжÏÊý¾Ý»º´æÇøÎª¿Õ¼´ÉÏÒ»¸ö×Ö½ÚÊý¾ÝÒѾ­±»Ë͵½·¢ËͼĴæÆ÷·¢ËͳöÈ¥ÁË
    // wait TX FIFO empty
    while (uart_handle[0].base->TX_FL)
    while (uart_handle[1].base->TX_FL)
    {
    }
    uart_send(UART_ID0, &c, 1, NULL);
    uart_send(UART_ID1, &c, 1, NULL);
}
void Serial0_PutString(uint8_t *s)