avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?


From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?
Date: Mon, 19 Sep 2005 17:46:52 +0200

On Mon, 2005-09-19 at 07:33 -0500, David Kelly wrote:

> Your putchar() (or whatever) writes to an LCD? So how long does it  
> take to latch a character into the LCD?

Yep I print to standard text LCD module (4x20), it takes about 45us for
the module to digest a character. 4 characters to send, that 0.2ms
maaaaximum. So they the LCD really can't be held responsible for the
6ms ;-)

I guess most of the time is used doing divisions to convert the byte in
digits. But still, that would be 5,000++ cycles just to divide a single
byte by 100 then 10, sound a bit dear... there must be space for further
improvement ! :-)


> Another way I thought to write the code without utoa() 

in your first two functions you used utoi, which wasn't recognized by
the gcc, so I had to look in the avr-libc PDF to search for an
equivalent and picked up itoa instead. But maybe that wasn't the
best(fastest) choice ?


> was something like this (no I haven't tried this one either):
> 
>      char buffer[4];
>      uint8_t i;
>      strncpy_P( buffer, PGM_P("000"), 3 );


Ah, it contains the same line that makes the compiler fail on your
another_dot_two() :

strncpy_P( buffer, PGM_P("000"), 3 );

It says :  

ui.c:65: error: parse error before "const"
make: *** [ui.o] Error 1




--
Vince





reply via email to

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