Browse Source

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

teensy4-core
PaulStoffregen 7 years ago
parent
commit
07906c1091
3 changed files with 5 additions and 2 deletions
  1. +3
    -0
      teensy3/HardwareSerial.h
  2. +1
    -1
      teensy3/serial2.c
  3. +1
    -1
      teensy3/serial3.c

+ 3
- 0
teensy3/HardwareSerial.h View File

// folder. The Windows installer puts Arduino in C:\Program Files (x86)\Arduino // 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 // 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. // 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 #define SERIAL_7E1 0x02

+ 1
- 1
teensy3/serial2.c View File

c = UART1_C3 & ~0x10; c = UART1_C3 & ~0x10;
if (format & 0x20) c |= 0x10; // tx invert if (format & 0x20) c |= 0x10; // tx invert
UART1_C3 = c; UART1_C3 = c;
#ifdef SERIAL_9BIT_SUPPORT
#if defined(SERIAL_9BIT_SUPPORT) && !defined(KINETISL)
c = UART1_C4 & 0x1F; c = UART1_C4 & 0x1F;
if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits) if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits)
UART1_C4 = c; UART1_C4 = c;

+ 1
- 1
teensy3/serial3.c View File

c = UART2_C3 & ~0x10; c = UART2_C3 & ~0x10;
if (format & 0x20) c |= 0x10; // tx invert if (format & 0x20) c |= 0x10; // tx invert
UART2_C3 = c; UART2_C3 = c;
#ifdef SERIAL_9BIT_SUPPORT
#if defined(SERIAL_9BIT_SUPPORT) && !defined(KINETISL)
c = UART2_C4 & 0x1F; c = UART2_C4 & 0x1F;
if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits) if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits)
UART2_C4 = c; UART2_C4 = c;

Loading…
Cancel
Save