time.h ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

time.h ?

Stokes, Mark
Are there any plans to include the functions in time.h into the mspgcc compiler?  If
not, has anyone done any of this coding?  It can get pretty complicated.  I'm including
a RTC and need a way to allow a human to enter the current date/time.  Maintaining a
long long is no problem (Unix time).

Thanks
-Mark


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: time.h ?

Garst R. Reese
Hi Mark,
Are you using an external RTC, f.ex. DS1390 with a battery backup?
What sort of input device are you using to enter the time?
I use the DS1390, and set the time when I programm the MSP. It can be
off by a few s due to the programming time, but the RTC will stay  up
for about 11y. If you are doing something similar, I can probably help.

Garst

Stokes, Mark wrote:

>Are there any plans to include the functions in time.h into the mspgcc compiler?  If
>not, has anyone done any of this coding?  It can get pretty complicated.  I'm including
>a RTC and need a way to allow a human to enter the current date/time.  Maintaining a
>long long is no problem (Unix time).
>
>Thanks
>-Mark
>
>
>-------------------------------------------------------
>SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
>from IBM. Find simple to follow Roadmaps, straightforward articles,
>informative Webcasts and more! Get everything you need to get up to
>speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&opÌk">http://ads.osdn.com/?ad_idt77&alloc_id492&opÌk
>_______________________________________________
>Mspgcc-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>  
>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

RE: time.h ?

Stokes, Mark
In reply to this post by Stokes, Mark
No, I'm using the internal 32k crystal to maintain the time with the basic timer.  The
accuracy is not critical, and when the main battery is replaced (~6years), the time
would need to be corrected for the time it takes to replace the battery.  I'm using it
for a datalogger output.
As you can probably tell, I can't stand to use 500uA to 2mA for active mode usage (as
the DS1390 uses).  I also don't even want to loose 60 to 175uA as this is almost 1/2 of
the overall system current.
It looks like from the datasheet, the function of the time.h functions is already built
in to the chip as everything is accessed in component parts (H:M:S;D:M:Y, etc).  I'm
maintaining the UNIX time variable (this is very easy), but need an easy way to have a
human enter that time (and I don't think telling them to go to a converter and get the
number is viable).

Thanks for the idea tho.
-Mark


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Garst R. Reese
Sent: Thursday, July 07, 2005 1:05 PM
To: [hidden email]
Subject: Re: [Mspgcc-users] time.h ?

Hi Mark,
Are you using an external RTC, f.ex. DS1390 with a battery backup?
What sort of input device are you using to enter the time?
I use the DS1390, and set the time when I programm the MSP. It can be
off by a few s due to the programming time, but the RTC will stay  up
for about 11y. If you are doing something similar, I can probably help.

Garst

Stokes, Mark wrote:

>Are there any plans to include the functions in time.h into the mspgcc compiler?  If
>not, has anyone done any of this coding?  It can get pretty complicated.  I'm including
>a RTC and need a way to allow a human to enter the current date/time.  Maintaining a
>long long is no problem (Unix time).
>
>Thanks
>-Mark
>
>
>-------------------------------------------------------
>SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
>from IBM. Find simple to follow Roadmaps, straightforward articles,
>informative Webcasts and more! Get everything you need to get up to
>speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&opÌk">http://ads.osdn.com/?ad_idt77&alloc_id492&opÌk
>_______________________________________________
>Mspgcc-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>  
>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick">http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: time.h ?

Mario Palomo
I've used a similar approach, but I only maintain 4 bytes with the UNIX time
and pass that value to another device that is the interface with humans. That
device was a PC using the RS-232 port, so in the PC I can use the time.h in a C
program that convert the UNIX time obtained from the MSP430 to an human
readable time and vice-versa. This approach can help you, or probably it can't
be useful in your system... I don't know.

Mario


Stokes, Mark wrote:

> No, I'm using the internal 32k crystal to maintain the time with the basic timer.  The
> accuracy is not critical, and when the main battery is replaced (~6years), the time
> would need to be corrected for the time it takes to replace the battery.  I'm using it
> for a datalogger output.
> As you can probably tell, I can't stand to use 500uA to 2mA for active mode usage (as
> the DS1390 uses).  I also don't even want to loose 60 to 175uA as this is almost 1/2 of
> the overall system current.
> It looks like from the datasheet, the function of the time.h functions is already built
> in to the chip as everything is accessed in component parts (H:M:S;D:M:Y, etc).  I'm
> maintaining the UNIX time variable (this is very easy), but need an easy way to have a
> human enter that time (and I don't think telling them to go to a converter and get the
> number is viable).
>
> Thanks for the idea tho.
> -Mark
>



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: time.h ?

Sergei Sharonov
In reply to this post by Stokes, Mark
Hi,
> No, I'm using the internal 32k crystal to maintain the time with the basic
timer. .........
> maintaining the UNIX time variable (this is very easy), but need an easy way
to have a
> human enter that time (and I don't think telling them to go to a converter and
get the
> number is viable).

I did exactly the same thing. There is a piece of code floating on the net that
implements time functions. You just need to provide tick increment every second.
Do not have the code handy.. just google for it.
It does add a bit of code space ~3 kB, and some funcs have internal
static strings that will eat into your ram.
As I recall the whole board was drawing 15 uA and most of it was going into
the 3.3V regulator output ;-). Should provide 7.7 years of operation from
1000 mA battery.

Sergei




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

RE: Re: time.h ?

Stokes, Mark
In reply to this post by Stokes, Mark
Well, I see a bunch of date conversion examples out there, mostly don't care about code
size or are C++ (OO).  That's all fine and dandy, but the question still stands,
conversion of the existing functions (which would work out of the box) for mspgcc.  The
only things I see that would need to be defined are defined in externs to the existing
library.  These could simply be defined in the main source code so the functions would
work properly.

Any thoughts?  I do not know what is involved in porting a standard library over to
mspgcc but am willing to at least look at it.

thanks
-Mark
 

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Sergei Sharonov
Sent: Thursday, July 07, 2005 3:42 PM
To: [hidden email]
Subject: [Mspgcc-users] Re: time.h ?

Hi,
> No, I'm using the internal 32k crystal to maintain the time with the basic
timer. .........
> maintaining the UNIX time variable (this is very easy), but need an easy way
to have a
> human enter that time (and I don't think telling them to go to a converter and
get the
> number is viable).

I did exactly the same thing. There is a piece of code floating on the net that
implements time functions. You just need to provide tick increment every second.
Do not have the code handy.. just google for it.
It does add a bit of code space ~3 kB, and some funcs have internal
static strings that will eat into your ram.
As I recall the whole board was drawing 15 uA and most of it was going into
the 3.3V regulator output ;-). Should provide 7.7 years of operation from
1000 mA battery.

Sergei




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

RE: Re: time.h ?

Rolf Freitag
In reply to this post by Stokes, Mark

Hi,

if you don't care about leap seconds and daylight saving time it's easy; i've done that
with portable data types (uint8_t, int16_t etc.) and functions which also calculate the calendar
week, day of year etc. from/to time(NULL) on MSP430.
With __DATE__ and __TIME__ it's easy to get a good approximation for time(NULL) on MSP430.

I'm using the same code for a RTAI kernel module for generating a DCF77 signal because with
Kernel 2.6 there is no function in kernel space which returns year, month, day etc. so i have to calculate
them from do_gettimeofday.

Regards,

Rolf


[hidden email] schrieb am 07.07.05 23:13:02:

>
> Well, I see a bunch of date conversion examples out there, mostly don't care about code
> size or are C++ (OO).  That's all fine and dandy, but the question still stands,
> conversion of the existing functions (which would work out of the box) for mspgcc.  The
> only things I see that would need to be defined are defined in externs to the existing
> library.  These could simply be defined in the main source code so the functions would
> work properly.
>
> Any thoughts?  I do not know what is involved in porting a standard library over to
> mspgcc but am willing to at least look at it.
>
> thanks
> -Mark
>  
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Sergei Sharonov
> Sent: Thursday, July 07, 2005 3:42 PM
> To: [hidden email]
> Subject: [Mspgcc-users] Re: time.h ?
>
> Hi,
> > No, I'm using the internal 32k crystal to maintain the time with the basic
> timer. .........
> > maintaining the UNIX time variable (this is very easy), but need an easy way
> to have a
> > human enter that time (and I don't think telling them to go to a converter and
> get the
> > number is viable).
>
> I did exactly the same thing. There is a piece of code floating on the net that
> implements time functions. You just need to provide tick increment every second.
> Do not have the code handy.. just google for it.
> It does add a bit of code space ~3 kB, and some funcs have internal
> static strings that will eat into your ram.
> As I recall the whole board was drawing 15 uA and most of it was going into
> the 3.3V regulator output ;-). Should provide 7.7 years of operation from
> 1000 mA battery.
>
> Sergei
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

RE: time.h ?

aekalman
In reply to this post by Stokes, Mark
Hi Sergei.

I've been Googling and can't find it -- can you give a link?

Much appreciated,

--Andrew

" I did exactly the same thing. There is a piece of code floating on the
net that
 implements time functions. You just need to provide tick increment every
second.
 Do not have the code handy.. just google for it.
 It does add a bit of code space ~3 kB, and some funcs have internal
 static strings that will eat into your ram.
 As I recall the whole board was drawing 15 uA and most of it was going into
 the 3.3V regulator output ;-). Should provide 7.7 years of operation from
 1000 mA battery.
 
 Sergei"


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

RE: Re: time.h ?

Stokes, Mark
In reply to this post by Stokes, Mark
This is fine also, and I have (out of frustration) already started on such functions.
HOWEVER, why reinvent the wheel? There are functions out there which are part of GCC
that will do it (probably a ton more efficiently than me, and definitely more tested
than any I write will ever be).
I'm not sure where you are getting "time(NULL)" on msp430 as I can't even include time.h
to use time(NULL).
I have no idea what RTAI and DCF77 are but I am interested specifically in a long long
unix time (my product should last longer than 2038) and must have the ability to "edit"
it by a human in the setup (not during normal operation).  The actual _use_ of the unix
time will be simply output to the datalogger (no conversions).

-Mark



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, July 07, 2005 6:27 PM
To: [hidden email]
Subject: RE: [Mspgcc-users] Re: time.h ?


Hi,

if you don't care about leap seconds and daylight saving time it's easy; i've done that
with portable data types (uint8_t, int16_t etc.) and functions which also calculate the
calendar
week, day of year etc. from/to time(NULL) on MSP430.
With __DATE__ and __TIME__ it's easy to get a good approximation for time(NULL) on
MSP430.

I'm using the same code for a RTAI kernel module for generating a DCF77 signal because
with
Kernel 2.6 there is no function in kernel space which returns year, month, day etc. so i
have to calculate
them from do_gettimeofday.

Regards,

Rolf


[hidden email] schrieb am 07.07.05 23:13:02:
>
> Well, I see a bunch of date conversion examples out there, mostly don't care about
code
> size or are C++ (OO).  That's all fine and dandy, but the question still stands,
> conversion of the existing functions (which would work out of the box) for mspgcc.
The

> only things I see that would need to be defined are defined in externs to the existing
> library.  These could simply be defined in the main source code so the functions would
> work properly.
>
> Any thoughts?  I do not know what is involved in porting a standard library over to
> mspgcc but am willing to at least look at it.
>
> thanks
> -Mark
>  
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Sergei Sharonov
> Sent: Thursday, July 07, 2005 3:42 PM
> To: [hidden email]
> Subject: [Mspgcc-users] Re: time.h ?
>
> Hi,
> > No, I'm using the internal 32k crystal to maintain the time with the basic
> timer. .........
> > maintaining the UNIX time variable (this is very easy), but need an easy way
> to have a
> > human enter that time (and I don't think telling them to go to a converter and
> get the
> > number is viable).
>
> I did exactly the same thing. There is a piece of code floating on the net that
> implements time functions. You just need to provide tick increment every second.
> Do not have the code handy.. just google for it.
> It does add a bit of code space ~3 kB, and some funcs have internal
> static strings that will eat into your ram.
> As I recall the whole board was drawing 15 uA and most of it was going into
> the 3.3V regulator output ;-). Should provide 7.7 years of operation from
> 1000 mA battery.
>
> Sergei
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Re: time.h ?

Garst R. Reese
Hmm, 32 bits will count the seconds between now and 2141.
Do you really need unix time?
Just a thought,

Garst

Stokes, Mark wrote:

>I have no idea what RTAI and DCF77 are but I am interested specifically in a long long
>unix time (my product should last longer than 2038) and must have the ability to "edit"
>it by a human in the setup (not during normal operation).  The actual _use_ of the unix
>time will be simply output to the datalogger (no conversions).
>
>-Mark
>  
>



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

RE: Re: time.h ?

Stokes, Mark
In reply to this post by Stokes, Mark
Actually, UNIX time is a signed 32-bit number, so it only makes it to 2038.  Microsoft
and others will have some fun then!!
As for me, I don't need the length of the 64bit, but I do want to make it past 2038, so
that's why I initially chose int64.  However, now that I think of it, it would make it
easier if I used int32 and made it unsigned.  That way it would last until 2106 or so.
(BTW, to be compatible w/ UNIX time (whether signed or not), the epoch time is 1/1/1970
0:0:0, so I've already lost 35 years!)
Thanks for the suggestion.
-Mark
 

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Garst R. Reese
Sent: Friday, July 08, 2005 9:54 AM
To: [hidden email]
Subject: Re: [Mspgcc-users] Re: time.h ?

Hmm, 32 bits will count the seconds between now and 2141.
Do you really need unix time?
Just a thought,

Garst

Stokes, Mark wrote:

>I have no idea what RTAI and DCF77 are but I am interested specifically in a long long
>unix time (my product should last longer than 2038) and must have the ability to "edit"
>it by a human in the setup (not during normal operation).  The actual _use_ of the unix
>time will be simply output to the datalogger (no conversions).
>
>-Mark
>  
>



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

RE: Re: time.h ?

Rolf Freitag
In reply to this post by Stokes, Mark

Hi,

time () has return type time_t and that's usually a 64 bit number on a 64 bit platform.
I'm using a time function which starts at 2000-01-01 0:00:00 so the warp will be in 2136
because i'm using uint32_t as time_t.

Regards,

Rolf


[hidden email] schrieb am 08.07.05 16:43:32:

>
> Actually, UNIX time is a signed 32-bit number, so it only makes it to 2038.  Microsoft
> and others will have some fun then!!
> As for me, I don't need the length of the 64bit, but I do want to make it past 2038, so
> that's why I initially chose int64.  However, now that I think of it, it would make it
> easier if I used int32 and made it unsigned.  That way it would last until 2106 or so.
> (BTW, to be compatible w/ UNIX time (whether signed or not), the epoch time is 1/1/1970
> 0:0:0, so I've already lost 35 years!)
> Thanks for the suggestion.
> -Mark
>  
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Garst R. Reese
> Sent: Friday, July 08, 2005 9:54 AM
> To: [hidden email]
> Subject: Re: [Mspgcc-users] Re: time.h ?
>
> Hmm, 32 bits will count the seconds between now and 2141.
> Do you really need unix time?
> Just a thought,
>
> Garst
>
> Stokes, Mark wrote:
>
> >I have no idea what RTAI and DCF77 are but I am interested specifically in a long long
> >unix time (my product should last longer than 2038) and must have the ability to "edit"
> >it by a human in the setup (not during normal operation).  The actual _use_ of the unix
> >time will be simply output to the datalogger (no conversions).
> >
> >-Mark





-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: time.h ?

Sergei Sharonov
In reply to this post by aekalman
Hi,

> I've been Googling and can't find it -- can you give a link?

Here you go:
http://www.jbox.dk/sanos/source/lib/time.c.html

It needs a bit of patching to work with msp430, but not much. I also recall a
couple of lines were truncated, probably due to c->html conversion.
I provided local static buffers instead of the ones from the kernel, e.g.
replace:
 char *ascbuf = gettib()->ascbuf;
with
 static char ascbuf[xxx];

Locate *timer thingy in no-init memory. Increment it from 1-second interrupt.
I used "reserve" (?) keyword for main() to get memory for it. Make access to it
atomic since it is 32-bit (2 word) value,
e.g. dint(), get *timer, eint().
Fix your includes.
There might have been something else, I do not recall..

Sergei





-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: time.h ?

aekalman
Thanks!

>Hi,
>
>>  I've been Googling and can't find it -- can you give a link?
>
>Here you go:
>http://www.jbox.dk/sanos/source/lib/time.c.html
>
>It needs a bit of patching to work with msp430, but not much. I also recall a
>couple of lines were truncated, probably due to c->html conversion.
>I provided local static buffers instead of the ones from the kernel, e.g.
>replace:
>  char *ascbuf = gettib()->ascbuf;
>with
>  static char ascbuf[xxx];
>
>Locate *timer thingy in no-init memory. Increment it from 1-second interrupt.
>I used "reserve" (?) keyword for main() to get memory for it. Make
>access to it
>atomic since it is 32-bit (2 word) value,
>e.g. dint(), get *timer, eint().
>Fix your includes.
>There might have been something else, I do not recall..
>
>Sergei
>
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
>July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
>core and dual graphics technology at this free one hour event hosted by HP,
>AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
>_______________________________________________
>Mspgcc-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/mspgcc-users


--
  ______________________________________
   Andrew E. Kalman, Ph.D.   [hidden email]


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Re: time.h ?

Rolf Freitag
In reply to this post by Stokes, Mark

Hi,

that's not bad but without leap seconds and without daylight saving time, so
the difference between that time and the local time is at minimum 10 s
because of the leap seconds and at maximum 3590 s because of the daylight saving time
( http://cr.yp.to/proto/utctai.html ).
It's not complicated to implement the daylight saving time but for the leap seconds
you need a lookup table because they can't be calculated.

Regards,

Rolf


[hidden email] schrieb am 08.07.05 19:05:21:

>
> Thanks!
>
> >Hi,
> >
> >>  I've been Googling and can't find it -- can you give a link?
> >
> >Here you go:
> >http://www.jbox.dk/sanos/source/lib/time.c.html
> >
> >It needs a bit of patching to work with msp430, but not much. I also recall a
> >couple of lines were truncated, probably due to c->html conversion.
> >I provided local static buffers instead of the ones from the kernel, e.g.
> >replace:
> >  char *ascbuf = gettib()->ascbuf;
> >with
> >  static char ascbuf[xxx];
> >
> >Locate *timer thingy in no-init memory. Increment it from 1-second interrupt.
> >I used "reserve" (?) keyword for main() to get memory for it. Make
> >access to it
> >atomic since it is 32-bit (2 word) value,
> >e.g. dint(), get *timer, eint().
> >Fix your includes.
> >There might have been something else, I do not recall..
> >
> >Sergei
> >
> >
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> >July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> >core and dual graphics technology at this free one hour event hosted by HP,
> >AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> >_______________________________________________
> >Mspgcc-users mailing list
> >[hidden email]
> >https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
> --
>   ______________________________________
>    Andrew E. Kalman, Ph.D.   [hidden email]
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Re: time.h ?

Garst R. Reese
  // Now adjust according to timezone and daylight saving time

If it's not adjusting for DST, what does the code following this comment do?


[hidden email] wrote:

>Hi,
>
>that's not bad but without leap seconds and without daylight saving time,
>
[snip]


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Re: time.h ?

Rolf Freitag
In reply to this post by Stokes, Mark

Hi,

the time calculated with that functions is TAI +10 s because the daylight savings time
is unused in the functions from http://www.jbox.dk/sanos/source/lib/time.c.html .
That's not bad but for localtime you have have to add the daylight saving time.

Regards,

Rolf


[hidden email] schrieb am 09.07.05 04:12:18:

>
>   // Now adjust according to timezone and daylight saving time
>
> If it's not adjusting for DST, what does the code following this comment do?
>
>
> [hidden email] wrote:
>
> >Hi,
> >
> >that's not bad but without leap seconds and without daylight saving time,
> >
> [snip]
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

RE: Re: time.h ?

Stokes, Mark
In reply to this post by Stokes, Mark
Thanks to all for the comments.  I have successfully ported the example from
http://www.jbox.dk/sanos/source/include/time.h.html into my project.  It works perfectly
and I'm not worried about 10 seconds.  Especially since according to
http://en.wikipedia.org/wiki/Unix_time they are not planning to adjust Unix time again.
Still seems like the useful functions: mktime() and gmtime() have a useful place in
mspgcc.
As for DST, I cannot use DST as this would wreak havoc with the datalogger output (two
hours of data with the same time/date stamp doesn't really work too well.  So, DST
compensation is not only turned off, but disabled in my app.

Again, thanks for the help.
-Mark


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Saturday, July 09, 2005 3:53 AM
To: [hidden email]
Subject: Re: [Mspgcc-users] Re: time.h ?


Hi,

the time calculated with that functions is TAI +10 s because the daylight savings time
is unused in the functions from http://www.jbox.dk/sanos/source/lib/time.c.html .
That's not bad but for localtime you have have to add the daylight saving time.

Regards,

Rolf


[hidden email] schrieb am 09.07.05 04:12:18:

>
>   // Now adjust according to timezone and daylight saving time
>
> If it's not adjusting for DST, what does the code following this comment do?
>
>
> [hidden email] wrote:
>
> >Hi,
> >
> >that's not bad but without leap seconds and without daylight saving time,
> >
> [snip]
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users