[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: re[avr-chat] ad data between DS1302 and ATMEGA8
From: |
Vincent Trouilliez |
Subject: |
Re: re[avr-chat] ad data between DS1302 and ATMEGA8 |
Date: |
Mon, 2 Feb 2009 15:50:00 +0100 |
> 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