Commit 35b1359a authored by Krzysztof Adamski's avatar Krzysztof Adamski Committed by Damien George

rp2: Use 0=Monday datetime convention in RTC.

The RTC in rp2 can store any, even wrong, number as a weekday in RTC.  It
was, however, discussed in #7394 that we would like to unify all ports and
use 0 as Monday, not Sunday in the machine.RTC implementation.

This patch makes sure that the default date set in RTC is adheres to this
convention.  It also fixes the example in quickref to use proper weekday to
avoid confusion.
Signed-off-by: default avatarKrzysztof Adamski <k@japko.eu>
parent 6409bbcb
......@@ -202,7 +202,7 @@ See :ref:`machine.RTC <machine.RTC>` ::
from machine import RTC
rtc = RTC()
rtc.datetime((2017, 8, 23, 1, 12, 48, 0, 0)) # set a specific date and time
rtc.datetime((2017, 8, 23, 2, 12, 48, 0, 0)) # set a specific date and time
rtc.datetime() # get date and time
WDT (Watchdog timer)
......
......@@ -80,7 +80,7 @@ int main(int argc, char **argv) {
.year = 2021,
.month = 1,
.day = 1,
.dotw = 5, // 0 is Sunday, so 5 is Friday
.dotw = 4, // 0 is Monday, so 4 is Friday
.hour = 0,
.min = 0,
.sec = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment