Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw/drivers/bme280: Fix writes to I2C #3307

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Sep 9, 2024

I2C writes when driver was enabled clear MSB of register address.

This prevented any write to control registers.

Now registers MSB is cleared on write only for SPI.

@jfclere
Copy link

jfclere commented Sep 9, 2024

That fixes my problem with bme280 and i2c.

@jfclere
Copy link

jfclere commented Sep 9, 2024

repos/apache-mynewt-core/hw/drivers/sensors/bme280/src/bme280.c:903:13: error: unused variable 'buf' [-Werror=unused-variable]
903 | uint8_t buf[len + 1];
| ^~~
cc1: all warnings being treated as errors

Fix move the definition inside the #if MYNEWT_VAL(BUS_DRIVER_PRESENT)

I2C writes when driver was enabled clear MSB of register
address.

This prevented any write to control registers.

Now registers MSB is cleared on write only for SPI.

Writing registers also requires single start condition.
Code was doing write with restart condtion that does not
seem to work correctly

Signed-off-by: Jerzy Kasenberg <[email protected]>
@kasjer kasjer merged commit 22ccc68 into apache:master Sep 10, 2024
19 checks passed
@kasjer kasjer deleted the kasjer/bme280-i2c-fix branch September 10, 2024 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants