Skip to content

Commit 6cd0c00

Browse files
pottekkatdeadprogram
authored andcommitted
chore: copy fix to esp32xx
Signed-off-by: Navendu Pottekkat <navendu@apache.org>
1 parent dc97300 commit 6cd0c00

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/machine/machine_esp32xx_i2c.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ func (i2c *I2C) transmit(addr uint16, cmd []i2cCommand, timeoutMS int) error {
186186
timeoutNS := int64(timeoutMS) * 1000000
187187
needAddress := true
188188
needRestart := false
189-
readLast := false
190189
var readTo []byte
191190
for cmdIdx, reg := 0, &i2c.Bus.COMD0; cmdIdx < len(cmd); {
192191
c := &cmd[cmdIdx]
@@ -254,7 +253,6 @@ func (i2c *I2C) transmit(addr uint16, cmd []i2cCommand, timeoutMS int) error {
254253
reg = nextAddress(reg)
255254
}
256255
if split {
257-
readLast = true
258256
reg.Set(i2cCMD_READLAST | 1)
259257
reg = nextAddress(reg)
260258
readTo = c.data[c.head : c.head+bytes+1] // read bytes + 1 last byte
@@ -285,7 +283,7 @@ func (i2c *I2C) transmit(addr uint16, cmd []i2cCommand, timeoutMS int) error {
285283
}
286284
}
287285
switch {
288-
case mask&esp.I2C_INT_STATUS_NACK_INT_ST_Msk != 0 && !readLast:
286+
case mask&esp.I2C_INT_STATUS_NACK_INT_ST_Msk != 0:
289287
return errI2CAckExpected
290288
case mask&esp.I2C_INT_STATUS_TIME_OUT_INT_ST_Msk != 0:
291289
if readTo != nil {

0 commit comments

Comments
 (0)