a demo code to use the RTC of Seeed Arch GPRS V2.0
Dependencies: DS1337 USBDevice mbed
Fork of Seeed_Arch_GPRS_V2_RTC_HelloWorld by
Diff: main.cpp
- Revision:
- 1:26f253123e05
- Parent:
- 0:262fddff13ae
--- a/main.cpp Tue Apr 29 12:59:10 2014 +0000 +++ b/main.cpp Sun May 04 09:12:38 2014 +0000 @@ -37,26 +37,6 @@ }TIME_S; TIME_S time_now; - -void time_init() -{ - RTC_DS1337.readTime(); - time_now.hour = RTC_DS1337.getHours(); - time_now.minutes = RTC_DS1337.getMinutes(); - time_now.second = RTC_DS1337.getSeconds(); - time_now.year = RTC_DS1337.getYears(); - time_now.month = RTC_DS1337.getMonths(); - time_now.day = RTC_DS1337.getDays(); - time_now.week = RTC_DS1337.getDayOfWeek(); - - time_buf.hour = RTC_DS1337.getHours(); - time_buf.minutes = RTC_DS1337.getMinutes(); - time_buf.second = RTC_DS1337.getSeconds(); - time_buf.year = RTC_DS1337.getYears(); - time_buf.month = RTC_DS1337.getMonths(); - time_buf.day = RTC_DS1337.getDays(); - time_buf.week = RTC_DS1337.getDayOfWeek(); -} void time_refresh() { @@ -90,7 +70,6 @@ int main() { setTime(); - time_init(); while(1) { time_refresh(); show_time();