]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avr/timer.asm
SVN --> GIT
[avrcpm.git] / avr / timer.asm
index 4b252307f3e9ef2b90d295a7e6dc956455e6ce5b..e64d0811b14fbda80db04d71447544fcc1d93b75 100644 (file)
@@ -17,7 +17,7 @@
 ;    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
@@ -80,7 +80,7 @@ clock:
        push    zh
        inm8    zl,OCR1BL
        inm8    zh,OCR1BH
-       addiw   z,F_CPU/1000
+       addiw   z,TC_1MS
        outm8   OCR1BH,zh
        outm8   OCR1BL,zl
 
@@ -406,8 +406,8 @@ rtc_get:
        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
@@ -417,8 +417,8 @@ rtc_get:
        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