diff options
| author | Krzysztof Adamski <k@japko.eu> | 2021-06-20 11:44:16 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-06-25 10:29:12 +1000 |
| commit | 35b1359a3ab082515e537bbb9129573e9dda1162 (patch) | |
| tree | 248c38de74ff08af1c6a3384578f4eac54af410c | |
| parent | 6409bbcb720be6c83d1fef3b7da14094b174a783 (diff) | |
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 <k@japko.eu>
| -rw-r--r-- | docs/rp2/quickref.rst | 2 | ||||
| -rw-r--r-- | 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 6bbe17954..4c8c02dc0 100644 --- a/docs/rp2/quickref.rst +++ b/docs/rp2/quickref.rst @@ -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) diff --git a/ports/rp2/main.c b/ports/rp2/main.c index 7709a478b..8c5772171 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, |
