Check for slave clock stretching
This indeed fixes the values read back: 80000000ff No buttons, no movement 80010000ff Left button 80050000ff Left+right buttons 80070000ff All buttons 800012fdff Force applied 80000fffff force applied
This commit is contained in:
@@ -1512,7 +1512,9 @@ _i2c_sda0:
|
|||||||
|
|
||||||
_i2c_scl1:
|
_i2c_scl1:
|
||||||
B0BCLR tpSCLM ; Set SCL to input
|
B0BCLR tpSCLM ; Set SCL to input
|
||||||
JMP $+1
|
@@:
|
||||||
|
B0BTS1 tpSCL ; Wait until SCL high
|
||||||
|
JMP @B
|
||||||
NOP
|
NOP
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@@ -1524,7 +1526,7 @@ _i2c_scl0:
|
|||||||
|
|
||||||
_i2c_start:
|
_i2c_start:
|
||||||
CALL _i2c_sda1 ; 8 cycles
|
CALL _i2c_sda1 ; 8 cycles
|
||||||
CALL _i2c_scl1 ; 8 cycles
|
CALL _i2c_scl1 ; 8+N cycles
|
||||||
CALL _i2c_sda0 ; 8 cycles
|
CALL _i2c_sda0 ; 8 cycles
|
||||||
CALL _i2c_scl0 ; 8 cycles
|
CALL _i2c_scl0 ; 8 cycles
|
||||||
RET
|
RET
|
||||||
|
|||||||
Reference in New Issue
Block a user