瀏覽代碼

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

main
PaulStoffregen 9 年之前
父節點
當前提交
0254d93d95
共有 3 個檔案被更改,包括 12 行新增0 行删除
  1. +4
    -0
      teensy3/serial1.c
  2. +4
    -0
      teensy3/serial2.c
  3. +4
    -0
      teensy3/serial3.c

+ 4
- 0
teensy3/serial1.c 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存