Thanks to all that respond.
Earl Jackson
VxWorks 3.2 for the AXPvme has the taskDelay function. Is that what you are
looking for?
Fred Zwarts Kernfysisch Versneller Instituut (KVI)
Zernikelaan 25 Phone: (+31/0)50 363 3619
9747 AA Groningen Fax: (+31/0)50 363 4003
The Netherlands E-mail: F.Zw...@KVI.nl
#define sleep(x) taskDelay(x * sysClkRateGet())
--
Donald McLachlan e-mail Donald.M...@crc.ca
Communications Research Centre / DRX office 613-998-2845
3701 Carling Ave., fax 613-998-9648
Ottawa, Ontario
K2H 8S2
Canada
I presume that when you says "VxWorks rejects the command nanosleep"
you mean that it says something about nanosleep being an undefined
symbol on download.
Your target system has to have the "nanosleep" compiled in to the kernel.
I believe this is a part of the ANSI routines; check your kernel config
to make sure you have
#define INCLUDE_ANSI_TIME
or
#define INCLUDE_ANSI_ALL
somewhere in config.h or configdb.h. Check the manual about timerLib.
I'm pretty sure that's the one, as I don't have "#include POSIX"
in my system, but I can do nanosleep.
One other option, which I'm not entirely certain about, is to
strip out the .o file containing nanosleep from the system libraries
and link directly with that. I believe it lives in timerLib.o,
which is in your lib<sys>gnuvx.a archive. However, it requires
the rest of the functions in timerLib (timer_cancel, etc.),
so it's probably not a good idea.
If you've got your system up, try doing a "lkup timer_connect"
on the target and see if the symbol comes back, or look through
the symbol table on the host. If it's not there, then timerLib
isn't on your target system, so you can't use nanosleep unless
you rebuild the kernel to include it.
If you can't, then the suggestions about taskDelay() are necessary,
as taskDelay is always on the system.
Keep in mind that the accuracy of taskDelay is with regards to the
system clock, so if you're running at something fairly slow, e.g.
60 Hz, you can't do taskDelay() on the order of 1 ms; you're limited
to integer clock ticks.
-- Kevin