Skip to content

Fix tm_mon#9

Open
jaredwolff wants to merge 1 commit intomasterfrom
fix-tm-mon-conversion
Open

Fix tm_mon#9
jaredwolff wants to merge 1 commit intomasterfrom
fix-tm-mon-conversion

Conversation

@jaredwolff
Copy link
Contributor

conversion bug causing date skips across months

The tm_mon field uses 0-11 range while PCF85063A hardware register
expects 1-12 range. This caused dates to skip when crossing month boundaries with different day counts.

  • pcf85063a_set_time: Convert tm_mon to 1-12 range before writing
  • pcf85063a_get_time: Convert from 1-12 range back to tm_mon 0-11 range

conversion bug causing date skips across months

The tm_mon field uses 0-11 range while PCF85063A hardware
register
expects 1-12 range. This caused dates to skip when crossing month
boundaries with different day counts.

- pcf85063a_set_time: Convert tm_mon to 1-12 range before writing
- pcf85063a_get_time: Convert from 1-12 range back to tm_mon 0-11
   range

Signed-off-by: Jared Wolff <hello@jaredwolff.com>
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