Changeset e5fd901 in rtems


Ignore:
Timestamp:
Jul 28, 2016, 10:01:58 AM (4 years ago)
Author:
Alexander Krutwig <alexander.krutwig@…>
Branches:
master
Children:
5c09e9d
Parents:
aaaf9610
git-author:
Alexander Krutwig <alexander.krutwig@…> (07/28/16 10:01:58)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/08/16 07:34:58)
Message:

atsam: Add atsam_rtc_get_time()

Location:
c/src/lib/libbsp/arm/atsam
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/atsam/include/bsp.h

    raaaf9610 re5fd901  
    8888extern char atsam_memory_sdram_size[];
    8989
     90void atsam_rtc_get_time(rtems_time_of_day *tod);
     91
    9092/** @} */
    9193
  • c/src/lib/libbsp/arm/atsam/rtc/rtc-config.c

    raaaf9610 re5fd901  
    2020#define ARBITRARY_DAY_OF_WEEK 1
    2121
    22 static void atsam_rtc_initialize(int minor)
    23 {
    24   Rtc *rtc = RTC;
    25 
    26   RTC_DisableIt(rtc, 0x1F);
    27 }
    28 
    29 static int atsam_rtc_get_time(int minor, rtems_time_of_day *tod)
     22void atsam_rtc_get_time(rtems_time_of_day *tod)
    3023{
    3124  Rtc *rtc = RTC;
     
    4841  tod->month = month;
    4942  tod->year = year;
     43}
     44
     45static void atsam_rtc_device_initialize(int minor)
     46{
     47  Rtc *rtc = RTC;
     48
     49  RTC_DisableIt(rtc, 0x1F);
     50}
     51
     52static int atsam_rtc_device_get_time(int minor, rtems_time_of_day *tod)
     53{
     54  atsam_rtc_get_time(tod);
    5055
    5156  return 0;
    5257}
    5358
    54 static int atsam_rtc_set_time(int minor, const rtems_time_of_day *tod)
     59static int atsam_rtc_device_set_time(int minor, const rtems_time_of_day *tod)
    5560{
    5661  Rtc *rtc = RTC;
     
    7782}
    7883
    79 static bool atsam_rtc_probe(int minor)
     84static bool atsam_rtc_device_probe(int minor)
    8085{
    8186  return true;
    8287}
    8388
    84 const rtc_fns atsam_rtc_ops = {
    85   .deviceInitialize = atsam_rtc_initialize,
    86   .deviceGetTime = atsam_rtc_get_time,
    87   .deviceSetTime = atsam_rtc_set_time
     89const rtc_fns atsam_rtc_device_ops = {
     90  .deviceInitialize = atsam_rtc_device_initialize,
     91  .deviceGetTime = atsam_rtc_device_get_time,
     92  .deviceSetTime = atsam_rtc_device_set_time
    8893};
    8994
     
    9297    .sDeviceName = "/dev/rtc",
    9398    .deviceType = RTC_CUSTOM,
    94     .pDeviceFns = &atsam_rtc_ops,
    95     .deviceProbe = atsam_rtc_probe
     99    .pDeviceFns = &atsam_rtc_device_ops,
     100    .deviceProbe = atsam_rtc_device_probe
    96101  }
    97102};
Note: See TracChangeset for help on using the changeset viewer.