Repository navigation
Conversation
zephcore_rtc_save() wrote the weekday as a binary 0-6 (Sunday 0) into whichever time-block byte the date does not use. The RX8130CE's WEEK register (13h) is one-hot: Epson ETM50E-10 14.1.2, Table 15, p. 27, gives Sunday 01h to Saturday 40h and says not to set more than one bit. So a Sunday was written as no day, a Monday as Sunday, and Wednesday, Friday and Saturday as two days at once, after every sync. ZephCore never reads the weekday back, so its time and date were unaffected; only the chip's week counter, and anything that reads it, was wrong. A new boolean weekday-one-hot descriptor property, set on the RX8130CE node in rtc-i2c.dtsi, makes the save write BIT(dow). The other chips keep the 0-6 encoding, as Zephyr's own DS3231, PCF8563 and RV3028 drivers write it. The same encoding as meshcore-dev/MeshCore#3550. Fixes fork issue #39. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Local review: the header said only the day-of-month offset varies between parts, so someone adding a chip with a one-hot weekday (Zephyr's rv8803 driver writes one) would not look for the property. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Missing optional-property handling can break RTC-enabled builds.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Fixes RX8130CE weekday persistence by encoding weekdays as one-hot values while preserving binary encoding for other RTCs.
Changes:
- Adds the
weekday-one-hotdevicetree property. - Marks RX8130CE descriptors as one-hot.
- Selects the configured encoding during RTC saves.
| File | Summary |
|---|---|
zephcore/dts/bindings/rtc/zephcore,rtc-i2c.yaml |
Defines weekday encoding metadata; its BCD comment should distinguish chip-specific weekday encoding. |
zephcore/boards/common/rtc-i2c.dtsi |
Marks RX8130CE descriptors as one-hot. |
zephcore/adapters/clock/ZephyrRTCDiscover.c |
Applies the configured weekday encoding; optional properties must be handled safely to avoid build failures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Copilot on fork #45: the header described the whole 7-byte block as BCD, which a one-hot weekday is not. It now says every field but the weekday is BCD, and that the weekday is a number 0-6 or one bit per day. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… define The DS3231 family defines its weekday register as 1-7, but ZephCore, like Zephyr's own rtc_ds3231.c, writes 0-6; the header now states the encoding ZephCore writes rather than claiming it for every chip. The time-reg description no longer calls the block BCD either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
On Copilot's overview of
Nothing to act on. The round names no finding, opens no thread, and lists only the two earlier threads as resolved, so there is no nit to answer. |
liquidraver#98 moved the time block into rtc_time_block(), shared by the save and the RV3028 write retry, so the one-hot weekday ternary moves there. Both descriptor fields and binding properties are kept, and the block's comment no longer calls the weekday byte BCD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The RX8130CE weekday is now written one-hot, which is not BCD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Opened upstream as liquidraver#101 from clean branch |
The YSN8900 is an RX8900 second source, and the board already uses the RX8900 register map for it. The RX8900's WEEK register (03h) is one-hot: Epson RX8900 Application Manual ETM45E-11, 8.2.2, Table 15, p. 16, Sunday 01h to Saturday 40h. The YSN8900's own data sheet is a one-page brief with no register map, and its programming guide is not available. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Folded in the meshtracker_x1 YSN8900 (44ed7e3), on Pieter's go, after merging |
|
Merged upstream as liquidraver#101 (2026-10-06), from the clean branch |


Fork iteration PR for the RX8130CE weekday fix (fork issue #39). It stays open as the iteration record; upstream sees only a squashed clean branch, and only once Pieter says so.
The defect (#39):
zephcore_rtc_save()writes the weekday as a binary 0-6 (Sunday 0). The RX8130CE's WEEK register (13h) is one-hot: Epson ETM50E-10 §14.1.2, Table 15, p. 27, Sunday01hto Saturday40h, "Do not set '1' to more than one day at the same time". So a Sunday was written as no day, a Monday as Sunday, and Wednesday, Friday and Saturday as two days at once, after every sync. ZephCore never reads the weekday back, so its time and date were unaffected.The fix, the same encoding as meshcore-dev/MeshCore#3550 and Zephyr's own
rtc_rx8130ce.c(wday2rtc(),1 << wday):weekday-one-hotdescriptor property, set on the RX8130CE node inrtc-i2c.dtsi. Every board with an RX8130CE (muziworks_r1neo, thinknode_m1/m3/m6, lilygo_techo, thinknode_m9) gets it from there.BIT(dow)when it is set,dowotherwise. The DS3231, PCF8563 and RV3028 keep 0-6, as Zephyr's own drivers for them write it.date-index.Not changed, needs its data sheet: meshtracker_x1's own
rtc-ysn8900@32node (RX8900 layout) still writes 0-6. Nothing in the tree states the RX8900's WEEK encoding, so it stays open on #39 rather than being guessed.Testing
thinknode_m1companion,muziworks_r1neorepeater,meshtracker_x1companion andrak4631repeater build with no warnings. The generated devicetree hasweekday_one_hot= 1 on the RX8130CE node and 0 on the DS3231, PCF8563, RV3028 and ysn8900 nodes.80h) accepts every one-hot value01h-40h, so identification is unchanged.Local review passes on each commit. They found the binding header's "only the day-of-month offset varies" and "7-byte BCD block" wording, and that the DS3231 family defines its weekday as 1-7 while ZephCore (like Zephyr's
rtc_ds3231.c) writes 0-6. All of that is fixed, and the header now says what ZephCore writes. Copilot's first round raised the same BCD wording (fixed) and aDT_PROPon an absent boolean, disproved in its thread.🤖 Generated with Claude Code