Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TFOX_CDMS_VR_1_0_WORKING by
Diff: RTC.cpp
- Revision:
- 3:0c3f7c3fabc9
- Parent:
- 2:4c79b3dfef31
- Child:
- 5:c77b49508927
--- a/RTC.cpp Mon Jun 15 13:32:28 2015 +0000
+++ b/RTC.cpp Tue Jun 16 09:04:53 2015 +0000
@@ -80,11 +80,14 @@
rtc_spi.write(0x87);
rtc_spi.write(0x01); //set year to 00(2000)
rtc_cs=1;
+ printf("\n\r rtc initalised \n");
}
uint8_t* FUNC_CDMS_RD_RTC()
+
{
uint8_t response;
+ printf("\n\r Entered rtc\n");
rtc_cs=1;
rtc_cs=0;
rtc_spi.write(0x00); //reading milliseconds register
@@ -131,8 +134,13 @@
rtc_spi.write(0x07); //reading year's registe
response =rtc_spi.write(0x01);
uint8_t year = ((response&0xF0)>>4)*10+(response&0x0F)*1;
+ rtc_cs=1;
//sprintf(Time_stamp,"%02d%02d%02d%02d%02d%02d%02d%02d",year, month, date, day, hours, minutes, seconds, milliseconds );
uint8_t Time_stamp[8] = {year, month, date, day, hours, minutes, seconds, milliseconds};
+ for(int i= 0; i<8;i++)
+ printf("%d\t",Time_stamp[i]);
printf("read\r\n");
return(Time_stamp);
}
+
+
