Since the Tmote Sky has no real time clock, and not even requires a clock that always runs, there's no concept of "time of day", so those functions aren't available. You could build your own if you have some way of obtaining the current time from somewhere (for example, querying a program running on the PC over the USB serial port or receiving a time base over the radio). I happened to come across this application note, which discusses how to implement your own real time clock: http://www.ti.com/lit/an/slaa076a/slaa076a.pdf. It probably has useful pointers to more detailed documentation. HTH, Michiel
> -----Original Message----- > From: Zhonghua [mailto:zhong...@sics.se] > Sent: vrijdag 24 februari 2012 14:51 > To: mspgcc-users@lists.sourceforge.net > Subject: [Mspgcc-users] Want use gettimeofday function , but there is > no sys/time.h in the include directory. > > Hi all, > > I want to get a time which resolution should be microsecond on Tmote > Sky. In my host computer and another platform E100 USRP I can use the > function of gettimeofday(). But through mspgcc-4.5.3, the > gettimeofday() is not accepted. Even after I added the time.h from my > host computer's include/sys directory into > /usr/local/msp430/include/sys/, it shows "undefined reference to > 'gettimeofday'. I checked the new added time.h, it uses an external > function definition, which means it will rely on an external function > do implement the practical function. But it seems this real external > function is not existing in mspgcc. I wrote the function as > http://svn.cod3r.com/a52codec/trunk/liba52/src/gettimeofday.c > directly, but the ftime() function in the invoked timeb.h is still an > external function. I guess maybe I haven't install some necessary lib. > I checked I have no gnulib, I don't know does it matter? > I have spent too much time on that. Does anybody know how to get a > relatively precise resolution time on Tmote Sky? Thanks in advance! > > Sincerely, > > Zhonghua ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users