Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default serial port for Teensy 3.0/3.1/3.2 and Teensy LC #63

Merged
merged 1 commit into from
Nov 4, 2016

Conversation

DavidMenting
Copy link
Contributor

The Teensy 3.0/3.1/3.2 boards should also default to using Serial1 as that is the first hardware UART as opposed to a USB serial device.

@@ -214,7 +214,7 @@ struct RPN
#define MIDI_CREATE_INSTANCE(Type, SerialPort, Name) \
midi::MidiInterface<Type> Name((Type&)SerialPort);

#if defined(ARDUINO_SAM_DUE) || defined(USBCON)
#if defined(ARDUINO_SAM_DUE) || defined(USBCON) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MKL26Z64__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any other definitions that could be used to precisely identify a Teensy 3.x ?

I'm thinking that if someone else uses the same arch/processor with a different core, they might not end up with the same Serial mapping.

This is highly theoretical though, so if there's no better alternative, I'll merge this change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, seems like this was mentioned a while ago already, in #33.

Also PR #29 seems to propose similar changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been looking around in the Teensy source code and could not find any other flags/defines that tell the compiler about the Teensy. Also, it is highly unlikely that anyone would want to use these Kinetis devices with the Arduino core without using Paul Stoffregen's Teensy code as a base.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find any specific defines either (apart from TEENSYDUINO=version), but there's something more interesting: SERIAL_PORT_HARDWARE_OPEN, defined in pins_arduino.h (or variant.h on non-avr architectures). It seems to suited for our needs, see #65.

@franky47 franky47 added this to the Backlog milestone Nov 4, 2016
@franky47 franky47 merged commit de51bcf into FortySevenEffects:master Nov 4, 2016
@franky47 franky47 modified the milestones: Backlog, v5.0 Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants