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>
This commit is contained in:
parent
6409bbcb72
commit
35b1359a3a
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user