Rtc

Fork of RTC-DS1307 by Henry Leinen

Files at this revision

API Documentation at this revision

Comitter:
RafaB
Date:
Wed Jun 10 16:01:49 2015 +0000
Parent:
9:5627b407e097
Commit message:
rtc

Changed in this revision

Rtc_Ds1307.cpp Show annotated file Show diff for this revision Revisions of this file
debug.h Show annotated file Show diff for this revision Revisions of this file
diff -r 5627b407e097 -r 32d0e8d7cc73 Rtc_Ds1307.cpp
--- a/Rtc_Ds1307.cpp	Wed Jun 26 21:05:46 2013 +0000
+++ b/Rtc_Ds1307.cpp	Wed Jun 10 16:01:49 2015 +0000
@@ -84,7 +84,7 @@
     time.wday = buffer[3]; 
     time.date = Rtc_Ds1307::bcdToDecimal( buffer[4]);
     time.mon = Rtc_Ds1307::bcdToDecimal( buffer[5]);
-    time.year = Rtc_Ds1307::bcdToDecimal(buffer[6]) + 2000;   //  plus hundret is because RTC is giving the years since 2000, but std c struct tm needs years since 1900
+    time.year = Rtc_Ds1307::bcdToDecimal(buffer[6]) + 2015;   //  plus hundret is because RTC is giving the years since 2000, but std c struct tm needs years since 1900
     
     return true;
 }
diff -r 5627b407e097 -r 32d0e8d7cc73 debug.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debug.h	Wed Jun 10 16:01:49 2015 +0000
@@ -0,0 +1,16 @@
+#ifndef __DEBUG_H__
+#define __DEBUG_H__
+
+
+#ifdef DEBUG
+#define INFO(x, ...) std::printf("[INFO: %s:%d]"x"\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
+#define WARN(x, ...) std::printf("[WARN: %s:%d]"x"\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
+#define ERR(x, ...) std::printf("[ERR: %s:%d]"x"\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
+#else
+#define INFO(x, ...)
+#define WARN(x, ...)
+#define ERR(x, ...)
+#endif
+
+
+#endif
\ No newline at end of file