Go Down

Topic: optimising for size (Read 1 time) previous topic - next topic


I posted some here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1157400799 and am in the process of creating a proper tutorial (and Makefile) for building and uploading Arduino sketches from the command line.


Wolf Paulus mentions a small hack to save 450 bytes - remove the legacy serial code support in arduino/lib/targets/arduino/wiring.c

Arduino's standard library still supports some legacy serial code, which can be removed by editing arduino/lib/targets/arduino/wiring.c (Arduino Version 0006):
Start commenting out code at line 241, insert /* just before void beginSerial(long baud)
This will reduce the size of a deployable program and increase the available memory for custom code by 450 Bytes, which doesn't sound like much but is equivalent to 6.3%.

-- http://wolfpaulus.com/journal/embedded/arduino.html

Not really so relevant for you guys working on pduino, but for us beginners reading this thread it's a nice tip.


Dec 01, 2006, 11:59 pm Last Edit: Dec 01, 2006, 11:59 pm by tateu Reason: 1
also, check out this post, it might help.
saved me almost 1k...

Lionel Lemarie

Impressive !
Using a combination of the patch and removing the legacy serial code, my code went from 4.4KB to 1.8KB. And it still works, bonus.

Thanks guys,

Go Up