Skip to content

Fix bitmask for reading year register in getDateTime()#8

Merged
rafacouto merged 1 commit intoTreboada:masterfrom
photomultiplier:bugfix/year-bitmask
Dec 29, 2023
Merged

Fix bitmask for reading year register in getDateTime()#8
rafacouto merged 1 commit intoTreboada:masterfrom
photomultiplier:bugfix/year-bitmask

Conversation

@photomultiplier
Copy link
Contributor

@photomultiplier photomultiplier commented Dec 29, 2023

Hello, and thanks for the awesome library!
I found a mistake in the bitmask used to read the year register in Ds1302::getDateTime(), which causes wrong readings when the year is greater than 80. This PR fixes it - I've already tested the change.
Cheers!

@rafacouto
Copy link
Collaborator

You're right, according to datasheet the register at 0x8D is a 8-bit mask:

image

Thank you for the PR! 👍

@rafacouto rafacouto merged commit 8531f01 into Treboada:master Dec 29, 2023
@photomultiplier photomultiplier deleted the bugfix/year-bitmask branch December 29, 2023 22:46
rafacouto referenced this pull request in danielc123/Ds1302 Jan 4, 2024
danielc123 added a commit to danielc123/Ds1302 that referenced this pull request Jan 21, 2024
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.

2 participants