1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/cc430
Benjamin Valentin b1724a7d1b periph/rtc: normalize struct tm before usage
A naive implementation may set a RTC alarm in 30s by calling

	struct tm now;
	rtc_get_time(&now);
	now.tm_sec += 30;
	rtc_set_alarm(&now, _cb, NULL);

This works for RTC implementations that use a RTT internally and call
mktime() to convert the struct tm to a unix timestamp, as mktime() will
normalize the struct in the process.

Call rtc_tm_normalize() when the RTC uses separate registers for time / date
components to ensure it is normalized.

This also modifies tests/periph_rtc to exercise this case.
2019-09-12 11:32:31 +02:00
..
include cpu*: fix doxygen grouping 2018-06-11 19:12:02 +02:00
periph periph/rtc: normalize struct tm before usage 2019-09-12 11:32:31 +02:00
cc430-adc.c cpu*: fix doxygen grouping 2018-06-11 19:12:02 +02:00
doc.txt cpu*: fix doxygen grouping 2018-06-11 19:12:02 +02:00
Makefile cpu: moved msp430-common to msp430_common 2017-01-13 13:33:32 +01:00
Makefile.features cpu: msp430: reorganize Makefile.features 2017-11-02 12:59:45 +01:00
Makefile.include periph_common: add as dependency to periph drivers 2019-06-03 13:44:10 +02:00