Skip to content

Commit

Permalink
Teensy LC doesn't support 9 bits on Serial2 & Serial3
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Sep 21, 2017
1 parent dba7390 commit 07906c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions teensy3/HardwareSerial.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion teensy3/serial2.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion teensy3/serial3.c
Expand Up @@ -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;
Expand Down

0 comments on commit 07906c1

Please sign in to comment.