This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: HAL_DELAY_US()


On 8/14/06, Andrew Lunn <andrew@lunn.ch> wrote:
>       float oneIteration=0.000001342194658704;
>       int iterations;
>       iterations=(int)(us*1000000*oneIteration);
>       busy(iterations);

float?

You really want to pull in the floating point library for a us delay
function? Why not use cyg_uint64 and shift the decimal place around so
you can do integer arithmatic.

This is the code I had lying around and as you point out and once the larger issue of whether something like this belongs in eCos is resolved, then it should be rewritten probably along the lines you suggest.


-- Øyvind Harboe http://www.zylin.com

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]