1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/lpc2387/periph
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
..
gpio.c lpc2387: mark closing #endif for MODULE_PERIPH_GPIO_IRQ 2018-10-09 15:11:00 +02:00
Makefile cpu: make use of Makefile.periph 2017-11-06 12:01:19 +01:00
pwm.c cpu/lpc2387: remove useless periph file guard 2018-04-16 10:11:47 +02:00
rtc.c periph/rtc: normalize struct tm before usage 2019-09-12 11:32:31 +02:00
spi.c cpu/lpc2387: Fixed broken SPI driver 2018-05-19 18:12:25 +02:00
timer.c Merge pull request #7129 from haukepetersen/opt_periph_sharetimerset 2017-08-01 15:09:48 +02:00
uart.c cpu/lpc2487: add empty uart/power_x functions 2018-03-02 10:53:55 +01:00