Teensy3: Serial1, Serial2, Serial2 separate code?

westfw

New member
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.
 
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....
 
Back
Top