Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

RTC_RX8130CE writes and reads the one-hot WEEK register as a number

Open Beginner friendly
#3,549 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ptr727 is already working on this.

Since Oct 4, 2026.

  • #3550 by @ptr727 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
embedded-iot

Research direction

Read src/helpers/RTC_RX8130CE.cpp, especially setTime() and getTime(), alongside the RX8130CE manual's week counter section. Update the write and read handling to use the one-hot weekday encoding described in the issue, including the stated behavior for old multi-bit values. Done when all seven weekdays round-trip correctly and an old multi-bit value decodes to its lowest set bit.

Written by the indexing model from the issue text.

Description

RTC_RX8130CE writes and reads the RX8130CE's WEEK register as a number. The chip encodes the day of the week one-hot, so on some days it holds no day at all, and on others it holds two days at once.

References:

The defect

§14.1.2 "Week counter" (p. 27) says the day of the week "is indicated by 7 bits, bit 0 to bit 6", counted as 01h → 02h → 04h → 08h → 10h → 20h → 40h → 01h. Table 15 sets Sunday = 01h through Saturday = 40h, and the manual says: "Do not set '1' to more than one day at the same time."

  • setTime() L98 writes bin2bcd(t->tm_wday) & 0x07. That gives:

    • Sunday (0): 00h, no day set.
    • Wednesday (3): 03h, Sunday and Monday both set.
    • Friday (5): 05h, Sunday and Tuesday both set.
    • Saturday (6): 06h, Monday and Tuesday both set.
    • Monday (1), Tuesday (2) and Thursday (4): 01h, 02h and 04h. Each is a single bit, but for the wrong day: Sunday, Monday and Tuesday.

    No day of the week is stored correctly.

  • getTime() L144 decodes it the same way, bcd2bin(buff[3] & 0x07), so a correctly encoded register (Thursday = 10h) would read back as 0.

Impact

Low. now() and unixtime() go through mktime(), which ignores tm_wday, so the date and time MeshCore uses are unaffected. What is wrong is the chip's own week counter:

  • It holds an invalid value, which the manual tells you not to write.
  • On a Sunday it holds no day at all.

That matters for a weekday alarm, which MeshCore doesn't use, and for any other firmware that reads the chip.

Proposed fix

  • Write: 1 << t->tm_wday.
  • Read: decode the position of the set bit, taking the lowest set bit when a chip still holds an old multi-bit value.

There are no other callers: tm_wday is written and read only in these two places.

The same defect was found independently in ZephCore: ptr727/liquidraver-ZephCore#39.

Dominant language
C
Stars
3.9k
Forks
1.5k
Avg merge
1d 1h
Merged PRs (30d)
26

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from meshcore-dev/MeshCore

All issues in meshcore-dev/MeshCore

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.