forked from GyverLibs/microDS3231
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
116 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
examples/RTClib comparsion/testDS3231_RTClib/testDS3231_RTClib.ino
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
examples/RTClib comparsion/testDS3231micro/testDS3231micro.ino
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=microDS3231 | ||
version=2.4 | ||
version=2.5 | ||
author=AlexGyver <[email protected]> | ||
maintainer=AlexGyver <[email protected]> | ||
sentence=Light library for DS3231 RTC module | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
Парсинг и получение даты и времени компиляции из __DATE__ и __TIME__ | ||
Документация: | ||
GitHub: https://github.com/GyverLibs/buildTime | ||
Константы времени компиляции: | ||
BUILD_YEAR - год | ||
BUILD_MONTH - месяц | ||
BUILD_DAY - день | ||
BUILD_HOUR - час | ||
BUILD_MIN - минута | ||
BUILD_SEC - секунда | ||
Исходник http://qaru.site/questions/186859/how-to-use-date-and-time-predefined-macros-in-as-two-integers-then-stringify | ||
AlexGyver, [email protected] | ||
https://alexgyver.ru/ | ||
MIT License | ||
Версии: | ||
v1.0 - релиз | ||
*/ | ||
|
||
|
||
#ifndef buildTime_h | ||
#define buildTime_h | ||
// Example of __DATE__ string: "Jul 27 2012" | ||
// 01234567890 | ||
|
||
#define BUILD_YEAR_CH0 (__DATE__[7]-'0') | ||
#define BUILD_YEAR_CH1 (__DATE__[8]-'0') | ||
#define BUILD_YEAR_CH2 (__DATE__[9]-'0') | ||
#define BUILD_YEAR_CH3 (__DATE__[10]-'0') | ||
#define BUILD_YEAR (BUILD_YEAR_CH0*1000+BUILD_YEAR_CH1*100 + BUILD_YEAR_CH2*10+BUILD_YEAR_CH3) | ||
|
||
#define BUILD_MONTH_IS_JAN (__DATE__[0] == 'J' && __DATE__[1] == 'a' && __DATE__[2] == 'n') | ||
#define BUILD_MONTH_IS_FEB (__DATE__[0] == 'F') | ||
#define BUILD_MONTH_IS_MAR (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'r') | ||
#define BUILD_MONTH_IS_APR (__DATE__[0] == 'A' && __DATE__[1] == 'p') | ||
#define BUILD_MONTH_IS_MAY (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'y') | ||
#define BUILD_MONTH_IS_JUN (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'n') | ||
#define BUILD_MONTH_IS_JUL (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'l') | ||
#define BUILD_MONTH_IS_AUG (__DATE__[0] == 'A' && __DATE__[1] == 'u') | ||
#define BUILD_MONTH_IS_SEP (__DATE__[0] == 'S') | ||
#define BUILD_MONTH_IS_OCT (__DATE__[0] == 'O') | ||
#define BUILD_MONTH_IS_NOV (__DATE__[0] == 'N') | ||
#define BUILD_MONTH_IS_DEC (__DATE__[0] == 'D') | ||
|
||
#define BUILD_MONTH \ | ||
( \ | ||
(BUILD_MONTH_IS_JAN) ? 1 : \ | ||
(BUILD_MONTH_IS_FEB) ? 2 : \ | ||
(BUILD_MONTH_IS_MAR) ? 3 : \ | ||
(BUILD_MONTH_IS_APR) ? 4 : \ | ||
(BUILD_MONTH_IS_MAY) ? 5 : \ | ||
(BUILD_MONTH_IS_JUN) ? 6 : \ | ||
(BUILD_MONTH_IS_JUL) ? 7 : \ | ||
(BUILD_MONTH_IS_AUG) ? 8 : \ | ||
(BUILD_MONTH_IS_SEP) ? 9 : \ | ||
(BUILD_MONTH_IS_OCT) ? 10 : \ | ||
(BUILD_MONTH_IS_NOV) ? 11 : \ | ||
(BUILD_MONTH_IS_DEC) ? 12 : \ | ||
/* error default */ '?' \ | ||
) | ||
|
||
#define BUILD_DAY_CH0 (((__DATE__[4] >= '0') ? (__DATE__[4]) : '0')-'0') | ||
#define BUILD_DAY_CH1 (__DATE__[5]-'0') | ||
#define BUILD_DAY (BUILD_DAY_CH0*10+BUILD_DAY_CH1) | ||
|
||
// Example of __TIME__ string: "21:06:19" | ||
// 01234567 | ||
|
||
#define BUILD_HOUR_CH0 (__TIME__[0]-'0') | ||
#define BUILD_HOUR_CH1 (__TIME__[1]-'0') | ||
#define BUILD_HOUR (BUILD_HOUR_CH0*10+BUILD_HOUR_CH1) | ||
|
||
#define BUILD_MIN_CH0 (__TIME__[3]-'0') | ||
#define BUILD_MIN_CH1 (__TIME__[4]-'0') | ||
#define BUILD_MIN (BUILD_MIN_CH0*10+BUILD_MIN_CH1) | ||
|
||
#define BUILD_SEC_CH0 (__TIME__[6]-'0') | ||
#define BUILD_SEC_CH1 (__TIME__[7]-'0') | ||
#define BUILD_SEC (BUILD_SEC_CH0*10+BUILD_SEC_CH1) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters