Skip to content

I2C write + read with a delay #479

Answered by bjoernQ
Fristi asked this question in Q&A
Apr 13, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I guess writing to the register triggers the measurement which might take up to 1500ms - then it's safe to read. It's a common pattern and I see no obvious problem with the code.

The blocking delay could be replaced with an async delay. We don't have support for async I2C yet but it should be fine to mix async/sync here.

Even with a blocking delay interrupts will still be served

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Fristi
Comment options

Answer selected by Fristi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants