浏览代码

Fix 9 bit mode on Serial1 & Serial2 on Teensy LC

main
PaulStoffregen 7 年前
父节点
当前提交
e8748e9b3c
共有 2 个文件被更改,包括 10 次插入4 次删除
  1. +5
    -2
      teensy3/serial1.c
  2. +5
    -2
      teensy3/serial2.c

+ 5
- 2
teensy3/serial1.c 查看文件

@@ -553,8 +553,11 @@ void uart0_status_isr(void)
}
#else
if (UART0_S1 & UART_S1_RDRF) {
n = UART0_D;
if (use9Bits && (UART0_C3 & 0x80)) n |= 0x100;
if (use9Bits && (UART0_C3 & 0x80)) {
n = UART0_D | 0x100;
} else {
n = UART0_D;
}
head = rx_buffer_head + 1;
if (head >= SERIAL1_RX_BUFFER_SIZE) head = 0;
if (head != rx_buffer_tail) {

+ 5
- 2
teensy3/serial2.c 查看文件

@@ -565,8 +565,11 @@ void uart1_status_isr(void)
}
#else
if (UART1_S1 & UART_S1_RDRF) {
n = UART1_D;
if (use9Bits && (UART1_C3 & 0x80)) n |= 0x100;
if (use9Bits && (UART1_C3 & 0x80)) {
n = UART1_D | 0x100;
} else {
n = UART1_D;
}
head = rx_buffer_head + 1;
if (head >= SERIAL2_RX_BUFFER_SIZE) head = 0;
if (head != rx_buffer_tail) {

正在加载...
取消
保存