Skip to content

fix: poll measuring status register instead of fixed sleep only#13

Merged
guillaumedelre merged 1 commit into
developfrom
fix/measurement-status-polling
May 14, 2026
Merged

fix: poll measuring status register instead of fixed sleep only#13
guillaumedelre merged 1 commit into
developfrom
fix/measurement-status-polling

Conversation

@guillaumedelre
Copy link
Copy Markdown
Owner

Summary

  • After the Appendix B minimum sleep, poll status register 0xF3 bit 3 (measuring) with up to 20 retries at 1ms intervals before reading raw data
  • Eliminates rare race condition where sensor is still measuring when data registers are read
  • Add test_read_all_polls_measuring_bit: verifies poll loop is triggered when measuring bit is active on first check

Per Bosch BME280 SensorAPI recommended flow.

Test plan

  • 21 tests pass: docker compose run --rm test

After the Appendix B minimum wait, poll 0xF3 bit 3 (measuring) until
the sensor confirms measurement completion, with up to 20 retries at
1ms intervals. Add test verifying the poll loop is exercised when the
measuring bit is initially active.

Co-authored-by: agilicode <agilicode@gmail.com>
@guillaumedelre guillaumedelre merged commit bb13f99 into develop May 14, 2026
3 checks passed
@guillaumedelre guillaumedelre deleted the fix/measurement-status-polling branch May 14, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant