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 ...
- 02-01-2012 #1Just Joined!
- Join Date
- Nov 2011
- Posts
- 62
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
- 02-02-2012 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,954
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!
- 02-02-2012 #3Just Joined!
- Join Date
- Nov 2011
- Posts
- 62
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??
- 02-02-2012 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,954
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!
- 02-02-2012 #5Just Joined!
- Join Date
- Nov 2011
- Posts
- 62
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.
- 02-02-2012 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,954
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!
- 02-09-2012 #7Just Joined!
- Join Date
- Nov 2011
- Posts
- 62
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


Reply With Quote
