From 35b1359a3ab082515e537bbb9129573e9dda1162 Mon Sep 17 00:00:00 2001 From: Krzysztof Adamski Date: Sun, 20 Jun 2021 11:44:16 +0200 Subject: [PATCH] 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: Krzysztof Adamski --- docs/rp2/quickref.rst | 2 +- ports/rp2/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rp2/quickref.rst b/docs/rp2/quickref.rst index 6bbe179541..4c8c02dc0c 100644 --- a/docs/rp2/quickref.rst +++ b/docs/rp2/quickref.rst @@ -202,7 +202,7 @@ See :ref:`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) diff --git a/ports/rp2/main.c b/ports/rp2/main.c index 7709a478bc..8c5772171a 100644 --- a/ports/rp2/main.c +++ b/ports/rp2/main.c @@ -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,