Skip to content

chore: remove "only BCD mode is supported" build warning - #128

Merged
fpistm merged 1 commit into
stm32duino:mainfrom
rayozzie:remove-bcd-only-warning
Nov 11, 2026
Merged

fpistm merged 1 commit into
stm32duino:mainfrom
rayozzie:remove-bcd-only-warning

Conversation

@rayozzie

@rayozzie rayozzie commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes issue #127

On series whose RTC has no binary mode, setBinaryMode() contains a #warning "only BCD mode is supported". STM32RTC.cpp is compiled in every build, so this warning appears on every build of every sketch that uses the library, including sketches that never call setBinaryMode() or only ask for MODE_BCD. When a warning shows up on every build, people learn to scroll past it, and then they also miss new warnings that matter.

This PR removes only that line. Behavior is unchanged:

  • On BCD-only series, setBinaryMode() still ignores the requested mode and sets MODE_BCD.
  • getBinaryMode() still returns the mode in effect, so a sketch that needs MODE_BIN or MODE_MIX can check whether it got it.
  • The README's "binary and mix modes" section still says that only some STM32 RTCs have a binary mode.

On series whose RTC has no binary mode, setBinaryMode() emitted a
compile-time #warning. Because STM32RTC.cpp is compiled in every build,
this fired on every build for every sketch using the library, whether or
not it called setBinaryMode() or asked for anything other than BCD.

The runtime behavior is unchanged: on these series the mode is still
forced to MODE_BCD, and getBinaryMode() reports the mode in effect.

Fixes stm32duino#127

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fpistm
fpistm merged commit f233164 into stm32duino:main Nov 11, 2026
3 checks passed
@fpistm fpistm added the enhancement New feature or request label Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

2 participants