Forum Rule: Always post complete source code & details to reproduce any issue!
-
Teensy3: Serial1, Serial2, Serial2 separate code?
So how come the drivers for the three serial ports on Teensy3 are three completely separate files/etc?
When I first saw this, I assumed there was some sort of hack to save space when only one was used, but even sketches that use no serial traffic at all end up including all three drivers...
-
Usually, there's one code base (C reentrant or C++ class), used for all three UARTs. Often, there are small differences in some of the UARTs like FIFO size, number of modem control lines. But this doesn't preclude a common core.
Including all 3 might be an issue with the infamous Arduino build process.
-
Senior Member

Originally Posted by
westfw
When I first saw this, I assumed there was some sort of hack to save space when only one was used,
That was actually the idea. It's never been realized, and reducing memory use has been a much lower priority than LOTS of other stuff, since Teensy 3.1 has plenty of memory.
But yes, it's someday supposed to save space. Ideas and especially pull requests are welcome....
-

Originally Posted by
PaulStoffregen
Ideas and especially pull requests are welcome....
Are templates allowed?
-
Senior Member
I generally don't use C++ templates. I'd rather than 3 copies of the source that resort to templates.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules