; You should have received a copy of the GNU General Public License
; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
;
-; $Id$
+; $Id: timer.asm 153 2014-11-12 12:59:42Z rapid $
;
.dseg
push zh
inm8 zl,OCR1BL
inm8 zh,OCR1BH
- addiw z,F_CPU/1000
+ addiw z,TC_1MS
outm8 OCR1BH,zh
outm8 OCR1BL,zl
rcall i2c_write
ldi temp2,3
rcall i2c_read ;get year (stored in RTC-RAM addr. 10h)
- tst temp
- brmi rtc_get_e ;i2c error
+ andi temp,0x3
+ breq rtc_get_e ;i2c error
ldd temp3,z+1 ;save year
ldd xl, z+2
rcall i2c_write
ldi temp2,6
rcall i2c_read
- tst temp
- brmi rtc_get_e
+ andi temp,0x3
+ breq rtc_get_e ;i2c error
mov temp2,xl ;year century
ldd temp,z+4 ;get year