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.
Revision 2:e79b6e5900b9, committed 2015-12-24
- Comitter:
- king33jp
- Date:
- Thu Dec 24 14:14:56 2015 +0000
- Parent:
- 1:c9d54daf068f
- Commit message:
- fix
Changed in this revision
| RTC_S35190.cpp | Show annotated file Show diff for this revision Revisions of this file |
| RTC_S35190.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/RTC_S35190.cpp Wed May 07 15:36:17 2014 +0000
+++ b/RTC_S35190.cpp Thu Dec 24 14:14:56 2015 +0000
@@ -200,6 +200,21 @@
return ddd;
}
+long RTC_S35190::getDaySerial2(char *rtc_today){
+ long ddd,yyy,dd,mm;
+ int mday[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
+ yyy = 2000+RtcData2Dec(rtc_today[0]);
+ mm = RtcData2Dec(rtc_today[1]);
+ dd = RtcData2Dec(rtc_today[2]);
+ ddd = (yyy) * 365;
+ ddd += (yyy/4)-(yyy/100)+(yyy/400);
+ for(int i=1;i<(mm-1);i++){
+ ddd += mday[i];
+ }
+ ddd = ddd + dd;
+ return ddd;
+}
+
long RTC_S35190::getTimeSerial(char *rtc_today){
long ss;
ss = RtcData2Dec(rtc_today[4]&0xBF)*60*60;
--- a/RTC_S35190.h Wed May 07 15:36:17 2014 +0000
+++ b/RTC_S35190.h Thu Dec 24 14:14:56 2015 +0000
@@ -27,6 +27,7 @@
void getDateStr(char *data,char *rtc_today);
void getTimeStr(char *data,char *rtc_today);
long getDaySerial(char *rtc_today);
+ long getDaySerial2(char *rtc_today);
long getTimeSerial(char *rtc_today);
private: