Sfoglia il codice sorgente

Teensy LC doesn't support 9 bits on Serial2 & Serial3

teensy4-core
PaulStoffregen 7 anni fa
parent
commit
07906c1091
3 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. +3
    -0
      teensy3/HardwareSerial.h
  2. +1
    -1
      teensy3/serial2.c
  3. +1
    -1
      teensy3/serial3.c

+ 3
- 0
teensy3/HardwareSerial.h Vedi File

@@ -40,6 +40,9 @@
// folder. The Windows installer puts Arduino in C:\Program Files (x86)\Arduino
// On Macintosh, you must control-click Arduino and select "Show Package Contents", then
// look in Contents/Java/hardware/teensy/avr/cores/teensy3 to find this file.
//
// Teensy 3.x boards support 9 bit mode on all their serial ports
// Teensy LC only supports 9 bit mode on Serial1. Serial2 & Serial3 can't use 9 bits.


#define SERIAL_7E1 0x02

+ 1
- 1
teensy3/serial2.c Vedi File

@@ -176,7 +176,7 @@ void serial2_format(uint32_t format)
c = UART1_C3 & ~0x10;
if (format & 0x20) c |= 0x10; // tx invert
UART1_C3 = c;
#ifdef SERIAL_9BIT_SUPPORT
#if defined(SERIAL_9BIT_SUPPORT) && !defined(KINETISL)
c = UART1_C4 & 0x1F;
if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits)
UART1_C4 = c;

+ 1
- 1
teensy3/serial3.c Vedi File

@@ -158,7 +158,7 @@ void serial3_format(uint32_t format)
c = UART2_C3 & ~0x10;
if (format & 0x20) c |= 0x10; // tx invert
UART2_C3 = c;
#ifdef SERIAL_9BIT_SUPPORT
#if defined(SERIAL_9BIT_SUPPORT) && !defined(KINETISL)
c = UART2_C4 & 0x1F;
if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits)
UART2_C4 = c;

Loading…
Annulla
Salva