[ECOS] Devio function context?

Grant Edwards grante@visi.com
Wed Mar 8 07:35:00 GMT 2000


On Wed, Mar 08, 2000 at 03:25:50PM +0000, Nick Garnett wrote:

> > OK, but...
> > 
> > 1) I couldn't find any cyg_drv_delay type of function.
> 
> There isn't. In general we decided that having device drivers
> implement timeouts or delays by using kernel facilities was a bad
> idea. 

I agree.  I think the only time you would use a delay mechanism
is when you're doing something from a thread. When/if the
functionality gets moved into an ISR or DSR, another mechanism
should be used, or more likely won't be needed.

> Of course if you need to use delays for internal timing purposes then
> this will not work. Our expectation was that such devices would either
> have their own timer facilities, or a separate hardware timer would be
> allocated and controlled from the driver directly. 

Right.

> For now, if you need to do this then by all means use
> cyg_thread_delay(), I'll put the need for this onto my TODO
> list and think about the best way to handle it for some future
> release.

I don't rellay think there is a need for non-thread delay
functionality.  

In the never-ending quest to stay off the critical path, I'm
slapping together a thread-mode driver (read and write methods
use polling via cyg_thread_dealy()) just so the application
development can get started.  Once things get underway,
switching to an interrupt-driven model will obviate the need
for the delay() -- and improve performance, one hopes...

> Wow! I hadn't realized that this table had got so mangled, this is
> what I originally passed over to the docs people:

Ah, that makes more sense!

-- 
Grant Edwards
grante@visi.com


More information about the Ecos-discuss mailing list