X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/bb5256eea0dbc764f2f447362e37d62ec060a5dc..79986122b1d8a4aaf015b8d30f20e99d78779342:/avr/i2c.asm diff --git a/avr/i2c.asm b/avr/i2c.asm index 4932173..0d96ace 100644 --- a/avr/i2c.asm +++ b/avr/i2c.asm @@ -74,7 +74,15 @@ ; ; wait ready: ; (1<= 0 No error +; > 0 status tbd. +; ;---------------------------------------------------------------------- .dseg @@ -112,7 +120,6 @@ i2c_buf: ldd temp2,z+oi2ci_idx inm8 temp,TWSR - cpi temp,TWI_START breq i2ci_START cpi temp,TWI_REP_START @@ -135,19 +142,19 @@ i2ci_REP_START: i2ci_MTX_ADR_ACK: i2ci_MTX_DATA_ACK: ldd temp,z+oi2c_bufcnt - cp temp2,temp - brsh i2ci_12 + cp temp2,temp ;all bytes tranmited? + brsh i2ci_12 ; yes add zl,temp2 adc zh,_0 inc temp2 - ldd temp,z+oi2c_buf + ldd temp,z+oi2c_buf ;next byte outm8 TWDR,temp ldi temp,(1<