Browse Source

Teensy-LC doesn't support CTS, so disable its code

main
PaulStoffregen 9 years ago
parent
commit
0254d93d95
3 changed files with 12 additions and 0 deletions
  1. +4
    -0
      teensy3/serial1.c
  2. +4
    -0
      teensy3/serial2.c
  3. +4
    -0
      teensy3/serial3.c

+ 4
- 0
teensy3/serial1.c View File

@@ -212,6 +212,7 @@ int serial_set_rts(uint8_t pin)

int serial_set_cts(uint8_t pin)
{
#if defined(KINETISK)
if (!(SIM_SCGC4 & SIM_SCGC4_UART0)) return 0;
if (pin == 18) {
CORE_PIN18_CONFIG = PORT_PCR_MUX(3) | PORT_PCR_PE; // weak pulldown
@@ -223,6 +224,9 @@ int serial_set_cts(uint8_t pin)
}
UART0_MODEM |= UART_MODEM_TXCTSE;
return 1;
#else
return 0;
#endif
}

void serial_putchar(uint32_t c)

+ 4
- 0
teensy3/serial2.c View File

@@ -216,6 +216,7 @@ int serial2_set_rts(uint8_t pin)

int serial2_set_cts(uint8_t pin)
{
#if defined(KINETISK)
if (!(SIM_SCGC4 & SIM_SCGC4_UART1)) return 0;
if (pin == 23) {
CORE_PIN23_CONFIG = PORT_PCR_MUX(3) | PORT_PCR_PE; // weak pulldown
@@ -225,6 +226,9 @@ int serial2_set_cts(uint8_t pin)
}
UART1_MODEM |= UART_MODEM_TXCTSE;
return 1;
#else
return 0;
#endif
}

void serial2_putchar(uint32_t c)

+ 4
- 0
teensy3/serial3.c View File

@@ -199,6 +199,7 @@ int serial3_set_rts(uint8_t pin)

int serial3_set_cts(uint8_t pin)
{
#if defined(KINETISK)
if (!(SIM_SCGC4 & SIM_SCGC4_UART2)) return 0;
if (pin == 14) {
CORE_PIN14_CONFIG = PORT_PCR_MUX(3) | PORT_PCR_PE; // weak pulldown
@@ -208,6 +209,9 @@ int serial3_set_cts(uint8_t pin)
}
UART2_MODEM |= UART_MODEM_TXCTSE;
return 1;
#else
return 0;
#endif
}

void serial3_putchar(uint32_t c)

Loading…
Cancel
Save