This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: HAL_DELAY_US()
Øyvind Harboe wrote:
Going through my changes to eCos, I ran into HAL_DELAY_US().
Does this function belong in the application or eCos?
If it can be implemented in a correct manner that does not require any
configuration, then I believe it belongs in the HAL.
If it needs to be tuned to the hardware in question, then I believe it
belongs in the application space.
The implementation in EB40a is busted because it is not
multithreading/interrupt safe.
Ref. earlier discussions HAL_DELAY_US() should take *at least* that
many us, there is no upper limit or requirement on precision as such.
IMO, HAL_DELAY_US() should not be used if interrupts or thread switches
can cause a perturbation. It's *only* function is to provide very simple
timing when devices require it. It should not be used for arbitrary delays,
certainly not in user/application code. For that, use 'cyg_thread_delay()'
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss