1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/cpu/sam0_common
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 sam0_common: add uart modecfg 2019-06-21 10:54:24 +02:00
ldscripts sam0_common: Adjust ldscript memory segment attributes 2018-05-09 06:49:02 +02:00
periph periph/rtc: normalize struct tm before usage 2019-09-12 11:32:31 +02:00
doc.txt cpu/sam0: update doc.txt with new MCU families 2019-07-17 11:37:46 +02:00
Makefile cpu/sam0: renamed sam21_common to sam0_common 2016-12-15 11:47:03 +01:00
Makefile.features sam0_common: add uart modecfg 2019-06-21 10:54:24 +02:00
Makefile.include cpu: do not locally export compilation variables 2019-08-29 10:35:53 +02:00