Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: Re: epicsTimer and rounding
From: Eric Norum <eric@norum.ca>
To: Ralph Lange <Ralph.Lange@gmx.de>
Cc: EPICS Core Talk <core-talk@aps.anl.gov>, Dirk Zimoch <dirk.zimoch@psi.ch>
Date: Fri, 8 Jun 2012 11:13:08 -0700
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
eric@norum.ca






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  <20122013  2014  2015  2016  2017  2018  2019  2020 
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  <20122013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 26 Nov 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·