@@ -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(); |
@@ -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(); |
@@ -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(); |
@@ -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(); |
@@ -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(); |
@@ -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(); |