Browse Source

Fix serial end() when errors are received but final interrupt never runs

teensy4-core
PaulStoffregen 6 years ago
parent
commit
c425ecbd0a
6 changed files with 12 additions and 0 deletions
  1. +2
    -0
      teensy3/serial1.c
  2. +2
    -0
      teensy3/serial2.c
  3. +2
    -0
      teensy3/serial3.c
  4. +2
    -0
      teensy3/serial4.c
  5. +2
    -0
      teensy3/serial5.c
  6. +2
    -0
      teensy3/serial6.c

+ 2
- 0
teensy3/serial1.c View File

@@ -222,6 +222,8 @@ void serial_end(void)
case 26: CORE_PIN26_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break;
#endif
}
UART0_S1;
UART0_D; // clear leftover error status
rx_buffer_head = 0;
rx_buffer_tail = 0;
if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial2.c View File

@@ -221,6 +221,8 @@ void serial2_end(void)
CORE_PIN9_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); // PTC3
CORE_PIN10_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); // PTC4
#endif
UART1_S1;
UART1_D; // clear leftover error status
rx_buffer_head = 0;
rx_buffer_tail = 0;
if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial3.c View File

@@ -196,6 +196,8 @@ void serial3_end(void)
case 20: CORE_PIN20_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break;
}
#endif
UART2_S1;
UART2_D; // clear leftover error status
rx_buffer_head = 0;
rx_buffer_tail = 0;
if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial4.c View File

@@ -168,6 +168,8 @@ void serial4_end(void)
case 32: CORE_PIN32_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break; // PTC4
case 62: CORE_PIN62_CONFIG = 0; break;
}
UART3_S1;
UART3_D; // clear leftover error status
rx_buffer_head = 0;
rx_buffer_tail = 0;
if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial5.c View File

@@ -153,6 +153,8 @@ void serial5_end(void)
UART4_C2 = 0;
CORE_PIN34_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1);
CORE_PIN33_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1);
UART4_S1;
UART4_D; // clear leftover error status
rx_buffer_head = 0;
rx_buffer_tail = 0;
if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial6.c View File

@@ -153,6 +153,8 @@ void serial6_end(void)
UART5_C2 = 0;
CORE_PIN47_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1);
CORE_PIN48_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1);
UART5_S1;
UART5_D; // clear leftover error status
rx_buffer_head = 0;
rx_buffer_tail = 0;
if (rts_pin) rts_deassert();

Loading…
Cancel
Save