kautsu / 400plus

Automatically exported from code.google.com/p/400plus
0 stars 0 forks source link

timestamp() is not giving me the timestamp #273

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I use bmp_printf(FONT_LARGE, 0, 50, "%d",timestamp());

What is the expected output? What do you see instead?
I expect something like 1344778679 and I get 9590 for example (the time since a 
did my first timestamp())

What version of the product are you using?
The last one.

Please provide any additional information below.
I'm a noob in C and CHDK developpement. So my issue might be a mistake made by 
myself.
And I speak very bad english (I'm french), so I'm sorry for any misspelling.

Original issue reported on code.google.com by tiboun...@gmail.com on 12 Aug 2012 at 1:43

GoogleCodeExporter commented 9 years ago
Yes, the timestamp() is not a real unix timestamp, it's the seconds elapsed 
since your first call of timestamp. It's an embedded system, so do not expect 
everything to be like in full-blown linux system ;)

You can check what timestamp() does here: 
http://code.google.com/p/400plus/source/browse/trunk/utils.c#658
Basically it calls clock_gettime() which is VxWorks routine:
http://www-kryo.desy.de/documents/vxWorks/V5.5/vxworks/ref/clockLib.html#clock_g
ettime
http://www.codeforge.com/read/191432/clockLib.c__html

Since we are using this time from clock_gettime(), we are unable to get a real 
unix timestamp, so we implement our relative timestamp.

Hope this helps.

Original comment by fired...@gmail.com on 12 Aug 2012 at 2:09

GoogleCodeExporter commented 9 years ago
Thank's for your reply. I've just saw the function _get_timestamp() that will 
allow me to do what I want. Can you close the issue ?

Original comment by tiboun...@gmail.com on 12 Aug 2012 at 4:51

GoogleCodeExporter commented 9 years ago
Closed, by request.

Original comment by eduardo....@gmail.com on 12 Aug 2012 at 4:55