Updated Adafruit Library
Fork of Adafruit_RTCLib by
Diff: DS1307.cpp
- Revision:
- 1:2c4e81ecda67
- Parent:
- 0:7f90c8e04249
- Child:
- 2:f372b273d88f
--- a/DS1307.cpp Tue Jul 17 05:49:20 2012 +0000 +++ b/DS1307.cpp Wed Jul 18 01:28:21 2012 +0000 @@ -4,6 +4,8 @@ /* * Taken from https://github.com/adafruit/RTClib * and modified for LPC1768 by Neal Horman July 2012 + * Also add support for access to the 56 bytes of + * user accessible battery backed ram. */ #include "mbed.h" @@ -19,6 +21,7 @@ RtcDs1307::RtcDs1307(I2C &i2c) : mI2c(i2c) { + // Read the RTC ram into the object RAM image mRam[0]=8; if(mI2c.write(DS1307_ADDRESS,(const char *)&mRam[0],1,true) == 0) mI2c.read(DS1307_ADDRESS,(char *)&mRam[1],sizeof(mRam)-1);