From 35e0a6453a845acf22ec6e6d6e09a630bb3232e9 Mon Sep 17 00:00:00 2001 From: Jiri Bilek Date: Sat, 3 Feb 2018 13:15:56 +0100 Subject: [PATCH] Fixing now() function The now() function was defined using the #define directive. That is wrong as it prevents using the keyword "now" in other situations. --- STM32F1/libraries/RTClock/src/RTClock.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/STM32F1/libraries/RTClock/src/RTClock.h b/STM32F1/libraries/RTClock/src/RTClock.h index 1988c9e..a3ff653 100755 --- a/STM32F1/libraries/RTClock/src/RTClock.h +++ b/STM32F1/libraries/RTClock/src/RTClock.h @@ -52,7 +52,9 @@ class RTClock { time_t getTime(); void getTime(tm_t & tmm ); - #define now getTime + + time_t now() { return getTime(); } + void now(tm_t & tmm ) { getTime(tmm); } // non-standard use of now() function, added for compatibility with previous versions of the library uint8_t year(void) { getTime(tmm); return tmm.year; } uint8_t month(void) { getTime(tmm); return tmm.month; } @@ -100,4 +102,4 @@ class RTClock { #endif // _RTCLOCK_H_ - \ No newline at end of file +