mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 19:44:00 +00:00
machine/stm32f103xx: fix i2c 2 byte read
This commit is contained in:
@@ -505,7 +505,12 @@ func (i2c I2C) Tx(addr uint16, w, r []byte) error {
|
|||||||
r[1] = byte(i2c.Bus.DR.Get())
|
r[1] = byte(i2c.Bus.DR.Get())
|
||||||
|
|
||||||
// wait for stop
|
// wait for stop
|
||||||
return i2c.waitForStop()
|
err = i2c.waitForStop()
|
||||||
|
|
||||||
|
//disable pos
|
||||||
|
i2c.Bus.CR1.ClearBits(stm32.I2C_CR1_POS)
|
||||||
|
|
||||||
|
return err
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
// Enable ACK of received data
|
// Enable ACK of received data
|
||||||
|
|||||||
Reference in New Issue
Block a user