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.
Этот коммит содержится в:
Ayke van Laethem 2020-01-05 07:45:10 +01:00 коммит произвёл Ron Evans
родитель 3745fb1c40
коммит 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--