avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] HowTo split a program into several files ?


From: Vincent Trouilliez
Subject: Re: [avr-chat] HowTo split a program into several files ?
Date: Tue, 13 Sep 2005 00:55:36 +0200

> The Makefile I sent to you started life as one of Joerg's demo
> Makefiles. The TWI demo IIRC.
> 
> Anyway, mine has some enhancements, yet its still simple. Just list your
> .c files in the SRCS definition. Is currently one file per line. The
> last character before newline is a backslash. Backslash escapes the
> newline and continues the logical line to the next physical line.


David I love you !!! :o)

It worked ! I just added main.c and lcd.c in your file, selected my
ATmega32 chip at the top of the file, and... it complained that my chip
couldn't use the "-gdwarf-2" option.  Not having the slightest clue as
to what this options meant, I simply removed it, ran make again, and
after a few apparently harmless warnings, it eventually coughed a few
files !!! :-)
The one called "object_flash.hex" caught my eye, tried downloading that
into the AVR using Avrdude and oh, magic, my program's running
perfectly !! :o)
Only thing I miss is that your "list" file, although it does contain the
entire program (main and lcd) doesn't show the C statements. I liked
these, as I could see what line in the source code generate what
assembler code. Since I am at the very beginning of my learning curve, I
spend lots of time looking at the assembler generated by every new C
statement I write or am unsure about, or curious to see how it's coded.
Hopefully I can modify your Makefile to generate this lovely file as
well :o)


Wow, what a day ! I learnt how to split my programs correctly using .c
and .h files, and I can also use Makefiles (and I already love them,
especially the "make clean" option ! :-), so convenient now I know it
does actually work ! ;-)
In short, I now have the basis to shape/structure/organize, and compile,
my programs properly, so that's very important. 

So, to all who spent time and effort today to help me, thank you, you
certainly didn't waste your time, and I sincerely appreciate your help.
Hopefully in a few years, I will get to the point where I can actually
give something back and help a newb... 



Regards,


--
Vince, super happy, 1AM, going to bed !...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]