Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, I am working on DM355 leopard board which is having 2.6.10 kernel and i want to get the time,data,and year when some externel interrupt comes .how will i do ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2011
    Posts
    68

    how to get time and date


    Hi,
    I am working on DM355 leopard board which is having 2.6.10 kernel and i want to get the time,data,and year when some externel interrupt comes .how will i do this? plz help me??

    Thanks

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    Huh? What do you mean EXACTLY by "external interrupt". I believe that what you mean by "interrupt" and what I understand it to mean are very different things...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Nov 2011
    Posts
    68
    Actually leopard board will take snap whenever some object comes . I want to track the time,date and year whenever it takes snap. For that should i read some rtc registers?? is that different for different processors??

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    You still are not (for me) being clear enough in what you mean, PRECISELY, by "whenever some object comes"...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Nov 2011
    Posts
    68
    hm.. In leopard board there is one camera module so i can take picture . If i am taking picture i want to save the picture as well as time, date and year.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    Well, when you save the image, the file system will preserve the created date+time of the image when it was stored. This does not require any additional operations.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Nov 2011
    Posts
    68
    Hi
    I could print time+date+year from rtc but i want to write it in to a file. Any idea??

    rtc_fd = open("/dev/rtc", O_RDONLY,0);
    ret = ioctl(rtc_fd, RTC_RD_TIME, &rtc_tm);
    printf("Current RTC date/time is %d-%d-%d, %02d:%02d:%02d.\r\n",
    rtc_tm.tm_mday, rtc_tm.tm_mon + 1, rtc_tm.tm_year+1900,
    rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •