Skip to content

Commit 5f42c13

Browse files
author
James Harton
committed
Enable support for all seven Teensy 4.0 UARTS.
1 parent e928ced commit 5f42c13

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

utility/SerialFirmata.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#define HW_SERIAL4 0x04
6767
#define HW_SERIAL5 0x05
6868
#define HW_SERIAL6 0x06
69-
// extensible up to 0x07
69+
#define HW_SERIAL7 0x07
7070

7171
#define SW_SERIAL0 0x08
7272
#define SW_SERIAL1 0x09
@@ -91,6 +91,8 @@
9191
#define RES_TX5 0x0b
9292
#define RES_RX6 0x0c
9393
#define RES_TX6 0x0d
94+
#define RES_RX7 0x0e
95+
#define RES_TX7 0x0f
9496

9597
// Serial command bytes
9698
#define SERIAL_CONFIG 0x10
@@ -143,6 +145,10 @@ namespace {
143145
#if defined(PIN_SERIAL6_RX)
144146
if (pin == PIN_SERIAL6_RX) return RES_RX6;
145147
if (pin == PIN_SERIAL6_TX) return RES_TX6;
148+
#endif
149+
#if defined(PIN_SERIAL7_RX)
150+
if (pin == PIN_SERIAL7_RX) return RES_RX7;
151+
if (pin == PIN_SERIAL7_TX) return RES_TX7;
146152
#endif
147153
return 0;
148154
}
@@ -193,6 +199,12 @@ namespace {
193199
pins.rx = PIN_SERIAL6_RX;
194200
pins.tx = PIN_SERIAL6_TX;
195201
break;
202+
#endif
203+
#if defined(PIN_SERIAL7_RX)
204+
case HW_SERIAL7:
205+
pins.rx = PIN_SERIAL7_RX;
206+
pins.tx = PIN_SERIAL7_TX;
207+
break;
196208
#endif
197209
default:
198210
pins.rx = 0;

0 commit comments

Comments
 (0)