[riot-notifications] [RIOT-OS/RIOT] cpu/sam0/i2c: Handle read with I2C_NOSTOP flag (#16605)

MrKevinWeiss notifications at github.com
Thu Jul 1 15:07:55 CEST 2021


### Contribution description

When using the I2C_NOSTOP flag the bus should remain in control.
The current check assumes it must go to idle when reading.
This adds a condition checks if the nostop flag is active
and expects the bus status to be the owner of the bus.

### Testing procedure

Connect a driver to a sam* based i2c bus and run `tests/periph_i2c`

```
i2c_acquire 0
i2c_read_byte 0 <my_device_address> 4
```

On master this will lockup, with this PR it should give one byte back.  Please note that other reads that don't contain a `I2C_NOSTART` (0x08) may cause errors.

... or I can just post the result outputs.
### Issues/PRs references

This was an error on the [PHiLIP based HiL CI](https://hil.riot-os.org/results/nightly/latest/saml10-xpro/tests_periph_i2c/log#s1-s4-t1) for a long time, I finally have time to check it.
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/16605

-- Commit Summary --

  * cpu/sam0/i2c: Handle read with I2C_NOSTOP flag

-- File Changes --

    M cpu/sam0_common/periph/i2c.c (10)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/16605.patch
https://github.com/RIOT-OS/RIOT/pull/16605.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16605
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210701/595b8430/attachment.htm>


More information about the notifications mailing list