@@ -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 |
@@ -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; |
@@ -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; |