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

AlarmBits parameter not initialized in getA1Time and getA2Time #51

Closed
franz-ap opened this issue Jan 28, 2022 · 0 comments · Fixed by #62
Closed

AlarmBits parameter not initialized in getA1Time and getA2Time #51

franz-ap opened this issue Jan 28, 2022 · 0 comments · Fixed by #62

Comments

@franz-ap
Copy link

I saw, that getA1Time and getA2Time do not clear parameter AlarmBits before setting certain bits there.
Probably they were written this way to facilitate combining the AlarmBits of these two functions when called in sequence.

Please add a note in DS3231.h, that variable AlarmBits needs to be cleared before calling getA1/2Time to avoid 'random' output.
Also clear that variable in DS3231_test.pde.
This may be a reason for issue #7 (Alarm 2 gives wrong Alarm bits back).

If combining the AlarmBits of A1 and A2 is not so important for you, you may want to change the first assignment of AlarmBits in getA1Time/getA2Time from
AlarmBits = AlarmBits | (temp_buffer & ...
to
AlarmBits = (temp_buffer & ...

jnuernberg added a commit that referenced this issue Aug 13, 2022
Merge branch '#51' of github.com:NorthernWidget/DS3231 into #51
@jnuernberg jnuernberg mentioned this issue Aug 13, 2022
Merged
jnuernberg added a commit that referenced this issue Aug 14, 2022
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 a pull request may close this issue.

1 participant