aboutsummaryrefslogtreecommitdiff
path: root/cores/robot/Platform.h
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2013-12-03 21:15:17 +0100
committerCristian Maglie <c.maglie@bug.st>2014-01-22 09:39:19 +0100
commit1848db3d66e232b10d7e701063f1238809cf6a53 (patch)
tree28e31399ee5203f350b0fe67477ef9d4999b8b36 /cores/robot/Platform.h
parent99f7ef7c673e02d559eb55d064f38a105393c8f6 (diff)
Put each HardwareSerial instance in its own .cpp file
By putting the ISRs and HardwareSerial instance for each instance in a separate compilation unit, the compile will only consider them for linking when the instance is actually used. The ISR is always referenced by the compiler runtime and the Serialx_available() function is always referenced by SerialEventRun(), but both references are weak and thus do not cause the compilation to be included in the link by themselves. The effect of this is that when multiple HardwareSerial ports are available, but not all are used, buffers are only allocated and ISRs are only included for the serial ports that are used. On the mega, this lowers memory usage from 653 bytes to just 182 when only using the first serial port. On boards with just a single port, there is no change, since the code and memory was already left out when no serial port was used at all. This fixes #1425 and fixes #1259.
Diffstat (limited to 'cores/robot/Platform.h')
0 files changed, 0 insertions, 0 deletions