Thanks to visit codestin.com
Credit goes to github.com

Skip to content

get_data_ready_status should watch 11 bits (not 10) #11

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

Closed
topherCantrell opened this issue Jan 15, 2022 · 5 comments
Closed

get_data_ready_status should watch 11 bits (not 10) #11

topherCantrell opened this issue Jan 15, 2022 · 5 comments
Assignees

Comments

@topherCantrell
Copy link

topherCantrell commented Jan 15, 2022

Section 3.8.2 of the SCD4x datasheet says to check the least significant 11 bits of the returned status. But the code on line 211 in "data_ready" only checks 8+2 = 10 bits. I've never ever seen that unchecked bit get set when data was not ready, but just in case it ever does -- we should AND the MSB with 7 (3 bits + 8) instead of 3 (2 bits + 8) to follow the datasheet.

@KeithTheEE
Copy link
Contributor

That's a good catch. Thank you for the really direct references, it was really easy to look up and see. I tried going through the Sensirion provided c code to see what they use, but c is not my specialty. I've got a sensor so I should be able to give it a shot regardless

@ladyada
Copy link
Member

ladyada commented Jan 21, 2022

! can y'all submit a PR?

@KeithTheEE
Copy link
Contributor

Yup! I should have one in tonight

@caternuson
Copy link
Contributor

Just adding to document:
image

@caternuson
Copy link
Contributor

Closing. Fixed with #12.

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

No branches or pull requests

4 participants