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:
Tobias Diedrich
2022-01-22 23:50:42 +01:00
parent b3b5bb5c58
commit 4270a2dfa5
+4 -2
View File
@@ -1512,7 +1512,9 @@ _i2c_sda0:
_i2c_scl1:
B0BCLR tpSCLM ; Set SCL to input
JMP $+1
@@:
B0BTS1 tpSCL ; Wait until SCL high
JMP @B
NOP
RET
@@ -1524,7 +1526,7 @@ _i2c_scl0:
_i2c_start:
CALL _i2c_sda1 ; 8 cycles
CALL _i2c_scl1 ; 8 cycles
CALL _i2c_scl1 ; 8+N cycles
CALL _i2c_sda0 ; 8 cycles
CALL _i2c_scl0 ; 8 cycles
RET