Skip to content

Commit 66e6762

Browse files
committed
Merge branch 'master' into serial-variant
2 parents b9c3e4a + 03c5bc9 commit 66e6762

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

hardware/arduino/avr/variants/mega/pins_arduino.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,4 +362,28 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
362362

363363
#endif
364364

365+
// These serial port names are intended to allow libraries and architecture-neutral
366+
// sketches to automatically default to the correct port name for a particular type
367+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
368+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
369+
//
370+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
371+
//
372+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
373+
//
374+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
375+
//
376+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
377+
//
378+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
379+
// pins are NOT connected to anything by default.
380+
#define SERIAL_PORT_MONITOR Serial
381+
#define SERIAL_PORT_HARDWARE Serial
382+
#define SERIAL_PORT_HARDWARE1 Serial1
383+
#define SERIAL_PORT_HARDWARE2 Serial2
384+
#define SERIAL_PORT_HARDWARE3 Serial3
385+
#define SERIAL_PORT_HARDWARE_OPEN Serial1
386+
#define SERIAL_PORT_HARDWARE_OPEN1 Serial2
387+
#define SERIAL_PORT_HARDWARE_OPEN2 Serial3
388+
365389
#endif

0 commit comments

Comments
 (0)