mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
machine/atsamd51: fix obvious bug in I2C code
I2C uses a hardcoded peripheral instead of referring to a specific peripheral. In addition to that, it refers to the wrong SERCOM (SERCOM3), which isn't used on any of the atsamd51 boards for I2C.
This commit is contained in:
committed by
Ron Evans
parent
3745fb1c40
commit
bdfa4d28cf
@@ -1008,7 +1008,7 @@ func (i2c I2C) WriteByte(data byte) error {
|
||||
timeout := i2cTimeout
|
||||
for !i2c.Bus.INTFLAG.HasBits(sam.SERCOM_I2CM_INTFLAG_MB) {
|
||||
// check for bus error
|
||||
if sam.SERCOM3_I2CM.STATUS.HasBits(sam.SERCOM_I2CM_STATUS_BUSERR) {
|
||||
if i2c.Bus.STATUS.HasBits(sam.SERCOM_I2CM_STATUS_BUSERR) {
|
||||
return errors.New("I2C bus error")
|
||||
}
|
||||
timeout--
|
||||
|
||||
Reference in New Issue
Block a user