rtc_run.c 690 B

123456789101112131415161718192021222324252627282930313233
  1. #include "rtc_run.h"
  2. static rtc_run_t RtcRun = {
  3. .year = RTC_INIT_YEAR,
  4. .month = RTC_INIT_MONTH,
  5. .day = RTC_INIT_DAY,
  6. .week = RTC_INIT_WEEK,
  7. .hour = RTC_INIT_HOUR,
  8. .minute = RTC_INIT_MIN,
  9. .second = RTC_INIT_SEC,
  10. .flag_1s = 0,
  11. .flag_1m = 0,
  12. .rsv = 0};
  13. void get_rtc_run(rtc_run_t **rtc_run)
  14. {
  15. *rtc_run = &RtcRun;
  16. }
  17. void set_rtc_run(rtc_run_t *rtc_run)
  18. {
  19. RtcRun.year = rtc_run->year;
  20. RtcRun.month = rtc_run->month;
  21. RtcRun.day = rtc_run->day;
  22. RtcRun.hour = rtc_run->hour;
  23. RtcRun.minute = rtc_run->minute;
  24. RtcRun.second = rtc_run->second;
  25. RtcRun.week = rtc_run->week;
  26. RtcRun.flag_1s = 0;
  27. RtcRun.flag_1m = 0;
  28. }