Re: DELAY performance...
Jason Thorpe <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.general |
|---|---|
| Message-ID | <[email protected]> |
On Aug 14, 2004, at 9:38 AM, Josh Sandbrook wrote:
> Hello...
> Im writing a driver for an LCD ( HD44780 ) which is wired to the
> printer port. Im having performance issues when throwing lots of data
> to it.. and I think it is because of the DELAY function.
> With each byte I send out the printer port to the lcd, I need to call
> DELAY() about 4 times, with about a 1100 usec delay in total. When I
> send many megs to the lcd, I find that the rest of the system gets
> very bogged down...
> AFAIK, DELAY halts the kernel from doing other things (except for
> handling interrupts). I am guessing that is what is causing most of
> the system slowdown..
> So, can anyone suggest a nicer way for me to delay ( even if it is not
> as accurate )?
You can either use a state machine to output the bytes and use
callout(9) to call your action functions after a period of time has
passed, or might be able to use tsleep(9) (tsleep() can only be called
from a process context, however).
-- Jason R. Thorpe <[email protected]>
PGP.sig
(application/pgp-signature, 186 B) - not displayed