Pages: [1]   Go Down
Author Topic: Removing the old serial libray:little Arduino hack  (Read 990 times)
0 Members and 1 Guest are viewing this topic.
Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 75
I Love Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A little Arduino hack...

add a "/*" (without the quotes) to line 214 of file wiring.c (in the folder "lib\targets\arduino") and get an extra 400+ bytes of programming space!
Oh and by doing this you can't use the Old deprecated serial library anymore  (see http://www.arduino.cc/en/Reference/HomePage for more info), but I think it's worth it, as the new Serial library is better.

I have been trying  to work the most punch out custom libraries lately. Just when you think your code is optimized, you compile it and discover it's larger than your previous version.

One thing I discovered, it's usually better to use more memory for variables, than using more functions.

Tom
Logged

Thomas Ouellet Fredericks

Forum Administrator
Offline Offline
Newbie
*****
Karma: 3
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

true

we might just drop the old library for version 5
maybe we should run a poll smiley

I'm sure we can optimise quite a bit of code.... the linker is a very important piece of the whole system
that we need to understand a lot better


massimo
Logged

Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 75
I Love Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For Aduino0005, since the old serial library was not removed, you have to remove it manually.
Since the file wiring.c hanged slightly, you must add a "/*" (without the quotes) at line 217 (just before "void beginSerial(long baud)")
That way, lines 217 to 320 are commented out.

Tom
Logged

Thomas Ouellet Fredericks

Forum Administrator
Offline Offline
Newbie
*****
Karma: 3
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

tom

thanks for the contribution!

remember that arduino 0005 doesn't exist yet smiley

it's marked 0005 in the svn but we're still working on it


massimo
Logged

Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 75
I Love Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh!  :o
 I recently reinstalled Arduino my Linux/Debian box, that's why version 0005.

Tom
Logged

Thomas Ouellet Fredericks

Pages: [1]   Go Up
Jump to: