Re: Purchase microcontroller dev. kit
- From: nico@xxxxxxxxxxx (Nico Coesel)
- Date: Wed, 27 Sep 2006 17:50:43 GMT
David Brown <david.brown@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Nico Coesel wrote:
"David L. Jones" <altzone@xxxxxxxxx> wrote:
try to compile the following on an AVR:
const char a[]={"hello world"}
char b[30];
char *p;
p=a;
strcpy(b,p);
strcat(b, "?");
printf("%s %s", a, b);
It won't work because the different memory areas will screw-up the
pointers. Some very smart and expensive compilers may be able to solve
these problems at the expense of speed.
That works perfectly well using avrgcc. Even on compilers which don't
support it directly, the way to deal with code like that is clearly
explained in user manuals and FAQs. You weren't suggesting that a
beginner should just wade in without looking at the manuals?
Of course, no one doing embedded development on a small microcontroller
would write code like that anyway - using printf is a sure sign you
don't know what you are doing.
Is it? All of my projects use printf (which usually comes in several
grades to tailor memory requirements) to print status information,
debug information and responses to commands send to a tiny command
line interpreter (a little more than a string compare on a list with
strings). And this is not even my idea.
Being able to have a sensible dialog with your hardware makes testing
and debugging much easier. Having a command line interface is also
very handy for field service. For instance: implement a command to
have it print the version & build date, and presto, you know exactly
which software is in the device.
--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
.
- Follow-Ups:
- Re: Purchase microcontroller dev. kit
- From: David Brown
- Re: Purchase microcontroller dev. kit
- References:
- Purchase microcontroller dev. kit
- From: ydoubleuz
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Re: Purchase microcontroller dev. kit
- From: mrdarrett
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Re: Purchase microcontroller dev. kit
- From: Donald
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Re: Purchase microcontroller dev. kit
- From: David L. Jones
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Re: Purchase microcontroller dev. kit
- From: David Brown
- Purchase microcontroller dev. kit
- Prev by Date: Re: Somebody Out There Must Think I'm Stupid....
- Next by Date: Re: another semi web site shot to hell?
- Previous by thread: Re: Purchase microcontroller dev. kit
- Next by thread: Re: Purchase microcontroller dev. kit
- Index(es):
Relevant Pages
|