[Top][All Lists]
[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 02:58:05 +0200 |
> The only alternative is:
> printf ("%d.%03d", x / 1000, x % 1000)
>
> I don't know the capabilities of avr libc, I hope it copes with the
> leading zero format.
Just tested it...
int main (void){
unsigned int value;
value = 6874;
while (TRUE) {
lcd_goto_rc(1,1); //display number in top left corner
PORTD = ~PORTD; //toggle port pins
printf ("%d.%03d", value / 1000, value % 1000);
PORTD = ~PORTD;
_delay_ms(50);
}
}
...compiles and runs fine, but my scope timed it at no less than
13ms !!!! I am running on the on-chip 1MHz RC oscillator, so that's
about 13,000 machine cycles then, ouch !
--
Vince
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, (continued)
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Jesper Hansen, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Anton Erasmus, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Vincent Trouilliez, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Jesper Hansen, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Kelly, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Vincent Trouilliez, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Vincent Trouilliez, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Richard Urwin, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?,
Vincent Trouilliez <=
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Kelly, 2005/09/18
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Vincent Trouilliez, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Kelly, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Dave Hansen, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Brown, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Richard Urwin, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Brown, 2005/09/20
- [avr-gcc-list] OT Generic C question, Trampas, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Bernard Fouché, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Colin Paul Gloster, 2005/09/20