EPICS Controls 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  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: epicsTimer and rounding
From: Eric Norum <[email protected]>
To: Ralph Lange <[email protected]>
Cc: EPICS Core Talk <[email protected]>, Dirk Zimoch <[email protected]>
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
[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  <20122013  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  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
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 ·