Skip to content

fix: DS3231 probe fix and constants cleanup#2

Merged
itsthisjustin merged 3 commits into
itsthisjustin:x3-supportfrom
vjapolitzer:x3-support
Feb 25, 2026
Merged

fix: DS3231 probe fix and constants cleanup#2
itsthisjustin merged 3 commits into
itsthisjustin:x3-supportfrom
vjapolitzer:x3-support

Conversation

@vjapolitzer

@vjapolitzer vjapolitzer commented Feb 22, 2026

Copy link
Copy Markdown

Summary

Fixes DS3231 probe

While checking if the hex value is <= 0x59 correctly filters out values where the tens digit is 6 or higher, it fails to catch invalid lower nibbles. For example, if a faulty read returns 0x0A, 0x1C, or 0x4F, the function will evaluate them as < 0x59 and return true, even though A, C, and F are invalid in BCD.

The updated function validates that both the tens digit and the ones digit fall within their valid decimal bounds:
tensDigit <= 5 && onesDigit <= 9.

I2C Constants Refactor

I have removed various hard-coded constants and moved them into defines in HalGPIO.h. For consistency and to provide a single location for relevant constants, I moved existing constexpr into these defines as well.


AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? NO

@itsthisjustin
itsthisjustin merged commit a8e209c into itsthisjustin:x3-support Feb 25, 2026
1 check passed
@vjapolitzer
vjapolitzer deleted the x3-support branch February 26, 2026 00:40
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