瀏覽代碼

Fix serial receive at high baud rates. Fixes #405

main
PaulStoffregen 4 年之前
父節點
當前提交
53625acd51
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      teensy4/HardwareSerial.cpp

+ 2
- 1
teensy4/HardwareSerial.cpp 查看文件

@@ -144,7 +144,8 @@ void HardwareSerial::begin(uint32_t baud, uint16_t format)
//hardware->rx_mux_register = hardware->rx_mux_val;
//hardware->tx_mux_register = hardware->tx_mux_val;

port->BAUD = LPUART_BAUD_OSR(bestosr - 1) | LPUART_BAUD_SBR(bestdiv);
port->BAUD = LPUART_BAUD_OSR(bestosr - 1) | LPUART_BAUD_SBR(bestdiv)
| (bestosr <= 8 ? LPUART_BAUD_BOTHEDGE : 0);
port->PINCFG = 0;

// Enable the transmitter, receiver and enable receiver interrupt

Loading…
取消
儲存