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

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

Re: [avr-gcc-list] Erasing For Loop


From: Daniel O'Connor
Subject: Re: [avr-gcc-list] Erasing For Loop
Date: Fri, 8 Apr 2005 14:17:28 +0930
User-agent: KMail/1.8

On Fri, 8 Apr 2005 13:51, Gary Griswold wrote:
>       DDRA = 0xFF;
> //Where m= month, k=day, c=century and d=year number.
>       k = t.day;
>       c = t.year/100;
>       d = t.year-c*100;
> //    m = t.month;
>
>       for ( m=1;   m==12; m++) {
>       DayNum = day_of_week ( m,k,c,d );
>       PORTA = DayNum;                                 }
>
> This little code fragment ran not at all.
> It's as if the loop does not exist;
> as a matter of fact, the loop  ERASED THE CODE!
>
> WHAT have I got set wrong???

Your loop conditional is wrong

It says..
Set m to 1
If m is 12 do
  DayNum = day_of_week ( m,k,c,d );
  PORTA = DayNum;
else
  exit loop

You probably want
for (m = 1; i <= 12; m++) {
...
}

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Attachment: pgp6rbJtKs4nO.pgp
Description: PGP signature


reply via email to

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