![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
vr1.1
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of CDMS_RTOS_v1_1 by
Diff: RTC.cpp
- Revision:
- 3:0c3f7c3fabc9
- Parent:
- 2:4c79b3dfef31
- Child:
- 5:c77b49508927
diff -r 4c79b3dfef31 -r 0c3f7c3fabc9 RTC.cpp --- 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); } + +