RTC_RX8130CE writes and reads the one-hot WEEK register as a number
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 manual: RX8130CE Application Manual, Seiko Epson, ETM50E-10, from the product page: https://www5.epsondevice.com/en/products/rtc/rx8130ce.html. Section, table and page numbers below are that document's, with printed page numbers.
- The code: upstream
dev3e3150c8.
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 writesbin2bcd(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,02hand04h. Each is a single bit, but for the wrong day: Sunday, Monday and Tuesday.
No day of the week is stored correctly.
- Sunday (0):
-
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de meshcore-dev/MeshCore
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
meshcore-dev/MeshCore#3622 ·
Los mantenedores suelen responder en 1 día
-
[Feature Request] Set Australia (Mid) Preset to automatically enable 2 byte default path hash sizeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
meshcore-dev/MeshCore#3571 · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
meshcore-dev/MeshCore#3567 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
meshcore-dev/MeshCore#3513 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
meshcore-dev/MeshCore#3409 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de meshcore-dev/MeshCore
Issues similares
-
os:linux
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
mpv-player/mpv#18649 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
facebookincubator/muse-gadget-sdk#249 ·
Los mantenedores suelen responder en 1 día
-
docs: nng_dial / nng_dialer_start can return NNG_ECONNSHUT and NNG_ECRYPTO, which are not documentedAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 89/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
micropython/micropython#19786 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
vercel-labs/zerolang#442 ·