mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
nrf: fix double stop signal in I2C
This commit is contained in:
committed by
Ron Evans
parent
9e61e6fe4d
commit
d39c7abb4d
@@ -260,10 +260,6 @@ func (i2c I2C) Configure(config I2CConfig) {
|
|||||||
// bytes and stores them in r, and generates a stop condition on the bus.
|
// bytes and stores them in r, and generates a stop condition on the bus.
|
||||||
func (i2c I2C) Tx(addr uint16, w, r []byte) (err error) {
|
func (i2c I2C) Tx(addr uint16, w, r []byte) (err error) {
|
||||||
i2c.Bus.ADDRESS.Set(uint32(addr))
|
i2c.Bus.ADDRESS.Set(uint32(addr))
|
||||||
defer func() {
|
|
||||||
i2c.signalStop()
|
|
||||||
i2c.Bus.SHORTS.Set(nrf.TWI_SHORTS_BB_SUSPEND_Disabled)
|
|
||||||
}()
|
|
||||||
|
|
||||||
if len(w) != 0 {
|
if len(w) != 0 {
|
||||||
i2c.Bus.TASKS_STARTTX.Set(1) // start transmission for writing
|
i2c.Bus.TASKS_STARTTX.Set(1) // start transmission for writing
|
||||||
|
|||||||
Reference in New Issue
Block a user