fossasia / pslab-firmware

Firmware for PSLab Open Hardware Platform https://pslab.io
Apache License 2.0
1.56k stars 76 forks source link

Fix i2c bulk read #175

Closed bessman closed 3 months ago

bessman commented 3 months ago

Summary by Sourcery

This pull request fixes an off-by-one error in the I2C bulk read function and adds a check to handle zero-byte read requests. Additionally, the firmware version patch number has been incremented.

sourcery-ai[bot] commented 3 months ago

Reviewer's Guide by Sourcery

This pull request addresses a bug in the I2C bulk read function by adding a check for zero count and adjusting the loop to start from 1. Additionally, the firmware version patch number has been incremented to reflect this change.

File-Level Changes

Files Changes
src/bus/i2c/i2c.c Fixed the bulk read operation by adding a zero count check and adjusting the loop to correctly handle the read operation.
src/helpers/device.c Updated the firmware version to reflect the new patch.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.