1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/periph_common: RTC: move RIOT_EPOCH to header, document it.

This commit is contained in:
Benjamin Valentin 2020-08-07 13:19:16 +02:00
parent 01e6b62667
commit 7543e714c1
2 changed files with 12 additions and 4 deletions

View File

@ -46,6 +46,18 @@
extern "C" {
#endif
#if !defined(RIOT_EPOCH) || DOXYGEN
/**
* @brief Earliest year of the RTC
*
* 01.01.$RIOT_EPOCH will be the reset value of the RTC if supported.
*
* Internal RTC helper functions such as @see rtc_mktime and @see rtc_localtime
* will not work on dates earlier than that.
*/
#define RIOT_EPOCH (2020)
#endif
/**
* @brief Signature for alarm Callback
*

View File

@ -31,10 +31,6 @@
#define HOUR (60U * MINUTE)
#define DAY (24U * HOUR)
#ifndef RIOT_EPOCH
#define RIOT_EPOCH (2020)
#endif
/*
* The rules here are (to be checked in that explicit order):
* 1. If the year is not a multiple of four, it is not a leap year.