[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] How to (efficeiently !!!) test a bitwithinamulti-byte
From: |
Vincent Trouilliez |
Subject: |
Re: [avr-gcc-list] How to (efficeiently !!!) test a bitwithinamulti-byte intege |
Date: |
Sat, 05 Nov 2005 01:18:38 +0100 |
> The bug is almost certainly a delay loop variable that is not declared
> volatile. The delay function is probably something like:
>
> void shortDelay(void) {
> uint8_t n = 50;
> while (n--);
> }
Correct :-)
actually I did'nt even make it a function, as I use it only in one
place, the routine the send the character to LCD and waits 40us for the
LCD to process it.
I delcared the loop counter volatile and that indeed fixed it, thanks !
I can now enjoy the massive shrinking (13KB+ down to 10KB !) of the -Os
flag :o)
> Note that it will not give you precise control of your delay - different
> optomisations or
> different compiler versions might give slightly different code, and may or
> may not inline the function. But in a case like this it doesn't matter -
> all you are looking for is a slight delay, and it doesn't matter if it is
> too long.
That's it... minimum delay is about 40us, but the actual delay is
completely irrelevant, as long as it doesn't take an hour to print a
string...
But well, admittedly, it's only a work around, and no real substitue for
proper polling of the busy flag. But that will keep me going until all
else is sorted, and I can get round to wiring the R/W line and updating
the LCD routines.... Okay, should take under 15 minutes door to door,
but well, I think I am just lazy today ;-)
--
Vince
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit withinamulti-byte intege, (continued)
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit withinamulti-byte intege, Dave Hansen, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bitwithinamulti-byte intege, David Brown, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Dave Hansen, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Dave Hylands, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Vincent Trouilliez, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Joerg Wunsch, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Vincent Trouilliez, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Joerg Wunsch, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Vincent Trouilliez, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) testabitwithinamulti-byte intege, Dave Hansen, 2005/11/07
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bitwithinamulti-byte intege,
Vincent Trouilliez <=
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bitwithinamulti-byte intege, David Kelly, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bitwithinamulti-byte intege, Vincent Trouilliez, 2005/11/05
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-byte integer ?, Derric Tubbs, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Alex Wenger, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Vincent Trouilliez, 2005/11/04
Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Bernard Fouché, 2005/11/04
Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Bernard Fouché, 2005/11/04