Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#3,549 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
c
Área
embedded-iot

Línea de trabajo

Lee src/helpers/RTC_RX8130CE.cpp, en especial setTime() y getTime(), junto con la sección del contador de semanas del manual del RX8130CE. Actualiza la gestión de escritura y lectura para usar la codificación one-hot del día de la semana descrita en la issue, incluido el comportamiento indicado para los valores antiguos de varios bits. Se termina cuando los siete días de la semana se convierten correctamente de ida y vuelta y un valor antiguo de varios bits se decodifica en su bit activado más bajo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C
Estrellas
3.9k
Forks
1.5k
Merge medio
18 h 59 min
PR fusionados (30 d)
28

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de meshcore-dev/MeshCore

Todos los issues de meshcore-dev/MeshCore

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.