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

Remove unused bits in Hrs3300::ReadAls, ReadHrs #875

Closed

Conversation

yehoshuapw
Copy link
Contributor

First, thanks a lot! great work making this and continuing to make it.

(commit message:)
Since both functions Hrs3300::ReadHrs, Hrs3300::ReadAls return
uint16_t:

  • removed extra 2 bits (at position 16,17) in HRS, which will be thrown
    out
  • removed unneeded checks of garbage bits in ALS, since they too will be
    thrown out.

I have a bit more doubts about the second change (not doing & 0x3f), since while it still does happen, it does not clearly say that the MSB of the H register is trash. (since for the uint16_t all the 3 MSB are trash)

Since both functions `Hrs3300::ReadHrs`, `Hrs3300::ReadAls` return
`uint16_t`:
* removed extra 2 bits (at position 16,17) in HRS, which will be thrown
  out
* removed unneeded checks of garbage bits in ALS, since they too will be
  thrown out.
@yehoshuapw
Copy link
Contributor Author

So after a discussion, it seems that the low level driver should not cut off the extra 2 bits, and that can (and perhaps should for memory issues) be done at a higher level.

Therefore, I am closing this PR.

@yehoshuapw yehoshuapw closed this Dec 13, 2021
@yehoshuapw yehoshuapw mentioned this pull request Dec 13, 2021
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