avr-chat
[Top][All Lists]
Advanced

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

Re: re[avr-chat] ad data between DS1302 and ATMEGA8


From: microhead
Subject: Re: re[avr-chat] ad data between DS1302 and ATMEGA8
Date: Tue, 3 Feb 2009 07:18:46 -0800 (PST)

Hi Vince,

Many thanks for your answer, your right, there was my fault with expression.
But I found there also, that shift is not same as rotation. So now I
remaking code.

Best Regards Martin



Vincent Trouilliez wrote:
> 
>> Dears all, there is some fault in following procedure. Function returns
>> value, but with same number.
> 
>> data>>1;
> 
> That might be your problem: "data>>" shifts data but does NOT put the
> result back into data.
> The compiler probably optimizes this statement out, as it has no effect in
> practice.
> 
> What you probably wanted to do was:
> 
> data = data >> 1;
> 
> or in short form:
> 
> data >>= 1;
> 
> 
> 
> HTH,
> 
> --
> Vince
> 
> 
> _______________________________________________
> AVR-chat mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-chat
> 
> 

-- 
View this message in context: 
http://www.nabble.com/read-data-between-DS1302-and-ATMEGA8-tp21761333p21811930.html
Sent from the AVR - General mailing list archive at Nabble.com.





reply via email to

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