summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-05-21 14:08:37 +1000
committerDamien George <damien.p.george@gmail.com>2018-05-21 14:08:37 +1000
commit6c955932f3c4bfa56336cbacad389d9f874cba10 (patch)
tree005b7c9d57d937e3fbfb0d888d1288cf62660464
parent6bd78741c13849da0570710ad6df80846df812c0 (diff)
stm32/rtc: Don't try to set SubSeconds value on RTC.
The hardware doesn't allow it, instead the value is reset to 255 upon setting the other calendar/time values.
-rw-r--r--docs/library/pyb.RTC.rst2
-rw-r--r--ports/stm32/rtc.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/docs/library/pyb.RTC.rst b/docs/library/pyb.RTC.rst
index 262855452..1a1df9095 100644
--- a/docs/library/pyb.RTC.rst
+++ b/docs/library/pyb.RTC.rst
@@ -31,7 +31,7 @@ Methods
With no arguments, this method returns an 8-tuple with the current
date and time. With 1 argument (being an 8-tuple) it sets the date
- and time.
+ and time (and ``subseconds`` is reset to 255).
.. only:: port_pyboard
diff --git a/ports/stm32/rtc.c b/ports/stm32/rtc.c
index 744fbe8b9..413403712 100644
--- a/ports/stm32/rtc.c
+++ b/ports/stm32/rtc.c
@@ -529,7 +529,6 @@ mp_obj_t pyb_rtc_datetime(size_t n_args, const mp_obj_t *args) {
time.Hours = mp_obj_get_int(items[4]);
time.Minutes = mp_obj_get_int(items[5]);
time.Seconds = mp_obj_get_int(items[6]);
- time.SubSeconds = rtc_us_to_subsec(mp_obj_get_int(items[7]));
time.TimeFormat = RTC_HOURFORMAT12_AM;
time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
time.StoreOperation = RTC_STOREOPERATION_SET;