Simple RTC class based on DS1307. Emphasis on simple. Allows you to run at 100k or 400k Hz (for newer DS1307 capable devices). MapTime() allows you to set the time() service to the same as the RTC. Uses struct tm throughout so you can use traditional time functions for manipulation.

Dependents:   AdaFruit_RGBLCD

Revision:
16:f7e4b4cbfb9e
Parent:
15:1645f55bd0ee
Child:
17:bdc15c054ac1
--- a/RTclock.cpp	Wed Oct 08 16:57:04 2014 +0000
+++ b/RTclock.cpp	Thu Oct 09 14:04:25 2014 +0000
@@ -41,6 +41,7 @@
         
         bool bPM = (0 != (aBuffer[2] & 0x20));
         if (bPM && 12 != out_sTM.tm_hour) out_sTM.tm_hour += 12;
+        if (!bPM && 12 == out_sTM.tm_hour) out_sTM.tm_hour = 0;
     }
     else
     {