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

case 26: CORE_PIN26_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break; case 26: CORE_PIN26_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break;
#endif #endif
} }
UART0_S1;
UART0_D; // clear leftover error status
rx_buffer_head = 0; rx_buffer_head = 0;
rx_buffer_tail = 0; rx_buffer_tail = 0;
if (rts_pin) rts_deassert(); if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial2.c View File

CORE_PIN9_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); // PTC3 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 CORE_PIN10_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); // PTC4
#endif #endif
UART1_S1;
UART1_D; // clear leftover error status
rx_buffer_head = 0; rx_buffer_head = 0;
rx_buffer_tail = 0; rx_buffer_tail = 0;
if (rts_pin) rts_deassert(); if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial3.c View File

case 20: CORE_PIN20_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break; case 20: CORE_PIN20_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break;
} }
#endif #endif
UART2_S1;
UART2_D; // clear leftover error status
rx_buffer_head = 0; rx_buffer_head = 0;
rx_buffer_tail = 0; rx_buffer_tail = 0;
if (rts_pin) rts_deassert(); if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial4.c View File

case 32: CORE_PIN32_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break; // PTC4 case 32: CORE_PIN32_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); break; // PTC4
case 62: CORE_PIN62_CONFIG = 0; break; case 62: CORE_PIN62_CONFIG = 0; break;
} }
UART3_S1;
UART3_D; // clear leftover error status
rx_buffer_head = 0; rx_buffer_head = 0;
rx_buffer_tail = 0; rx_buffer_tail = 0;
if (rts_pin) rts_deassert(); if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial5.c View File

UART4_C2 = 0; UART4_C2 = 0;
CORE_PIN34_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); 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); 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_head = 0;
rx_buffer_tail = 0; rx_buffer_tail = 0;
if (rts_pin) rts_deassert(); if (rts_pin) rts_deassert();

+ 2
- 0
teensy3/serial6.c View File

UART5_C2 = 0; UART5_C2 = 0;
CORE_PIN47_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_MUX(1); 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); 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_head = 0;
rx_buffer_tail = 0; rx_buffer_tail = 0;
if (rts_pin) rts_deassert(); if (rts_pin) rts_deassert();

Loading…
Cancel
Save