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.
Этот коммит содержится в:
родитель
3745fb1c40
коммит
bdfa4d28cf
1 изменённых файлов: 1 добавлений и 1 удалений
|
@ -1008,7 +1008,7 @@ func (i2c I2C) WriteByte(data byte) error {
|
||||||
timeout := i2cTimeout
|
timeout := i2cTimeout
|
||||||
for !i2c.Bus.INTFLAG.HasBits(sam.SERCOM_I2CM_INTFLAG_MB) {
|
for !i2c.Bus.INTFLAG.HasBits(sam.SERCOM_I2CM_INTFLAG_MB) {
|
||||||
// check for bus error
|
// 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")
|
return errors.New("I2C bus error")
|
||||||
}
|
}
|
||||||
timeout--
|
timeout--
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче