Pages: [1]   Go Down
Author Topic: Blank sketch takes up 466 bytes???  (Read 696 times)
0 Members and 1 Guest are viewing this topic.
Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyone have any ideas why this is happening?

Thanks,
baum


* Screen Shot 2012-02-22 at 10.43.17 AM.png (47.84 KB, 563x564 - viewed 27 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You sure that isn't the size it should be? Because I'm getting the same compiled size.
466 bytes is under half a KB, just saying...
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

apart from calling your empty code, it has quite a lot of housekeeping to set up, in case you use resources, like pins!



edit: it does housekeeping, you have to manage your own hose keeping!
« Last Edit: February 22, 2012, 11:04:10 am by mmcp42 » Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So even if I don't use a certain function, it may still be compiled? In that case I may compile some of my code myself with avr-gcc and just include avr/io.h...

baum
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

not quite
but the i/o systems and timers have to be initialised
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

New Jersey
Offline Offline
Faraday Member
**
Karma: 67
Posts: 3693
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So even if I don't use a certain function, it may still be compiled? In that case I may compile some of my code myself with avr-gcc and just include avr/io.h...

baum

Are you expecting your sketch to consume enough flash that it'll be an issue?
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You have code for setup and loop. The compiler still has to set those things up as well as setting up the normal environment stuff. No big deal, its a "problem" anytime you use a high level language. Minimal code for a stepper driver I wrote was 1200 bytes in C and 88 bytes in assembler. The compiler is setup for doing something useful and there is some overhead because of that. If you want to create an empty program, Oh well, your are going to see some of that overhead. There is a lot of register pushing and popping whenever a function is called along with other code that is just there to make things work.
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK. I'll try it w/out Arduino and see what the size of my program is... Thanks for the help!

baum
Logged

Pages: [1]   Go Up
Jump to: