I see that these semantics have already been described -- mail was out here for about 3 hours thus my comments seem a little anachronistic now….
So -- is this the right implementation for RTEMS?
It adds an int->float conversion and a float comparison, but I can't see anything simpler.
void
epicsThreadSleep (double seconds)
{
rtems_status_code sc;
rtems_interval delay;
double xDelay;
extern double rtemsTicksPerSecond_double;
if (seconds <= 0.0) {
delay = 0;
}
else {
delay = xDelay = seconds * rtemsTicksPerSecond_double;
if (delay != xDelay)
delay++;
}
sc = rtems_task_wake_after (delay);
if(sc != RTEMS_SUCCESSFUL)
errlogPrintf("epicsThreadSleep: %s\n", rtems_status_text (sc));
}
--
Eric Norum
[email protected]
- References:
- epicsTimer and rounding Ralph Lange
- RE: epicsTimer and rounding Hill, Jeff
- Re: epicsTimer and rounding Ralph Lange
- Re: epicsTimer and rounding Eric Norum
- RE: epicsTimer and rounding Hill, Jeff
- Re: epicsTimer and rounding Ralph Lange
- Re: epicsTimer and rounding Eric Norum
- Navigate by Date:
- Prev:
Re: epicsTimer and rounding Ralph Lange
- Next:
Re: epicsTimer and rounding Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: epicsTimer and rounding Eric Norum
- Next:
RE: epicsTimer and rounding Hill, Jeff
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|