瀏覽代碼

Fix 9 bit transmit mode on Serial3

teensy4-core
PaulStoffregen 9 年之前
父節點
當前提交
5c9ccd8412
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. +4
    -2
      teensy3/serial3.c

+ 4
- 2
teensy3/serial3.c 查看文件

@@ -151,7 +151,7 @@ void serial3_set_transmit_pin(uint8_t pin)

void serial3_putchar(uint32_t c)
{
uint32_t head;
uint32_t head, n;

if (!(SIM_SCGC4 & SIM_SCGC4_UART2)) return;
if (transmit_pin) *transmit_pin = 1;
@@ -163,7 +163,9 @@ void serial3_putchar(uint32_t c)
if ((UART2_S1 & UART_S1_TDRE)) {
uint32_t tail = tx_buffer_tail;
if (++tail >= TX_BUFFER_SIZE) tail = 0;
UART2_D = tx_buffer[tail];
n = tx_buffer[tail];
if (use9Bits) UART2_C3 = (UART2_C3 & ~0x40) | ((n & 0x100) >> 2);
UART2_D = n;
tx_buffer_tail = tail;
}
} else if (priority >= 256) {

Loading…
取消
儲存