Re: Sleeping
=?iso-8859-1?Q?Bj=F8rn?= =?iso-8859-1?Q?R=F8geberg?= (bjornr@ifi.uio.no)
13 Sep 1996 14:50:18 +0200
In article <Pine.LNX.3.91.960906131537.1300B-100000@panasync.canuck.ca>, Colten Edwards <edwards@panasync.canuck.ca> writes:
>
> I haven't been able to find this anywhere, but I need to know what a good
> way to sleep within a kernel module is. I found something called
> lcdpanel-0.50.tar.gz on sunsite and have made the LCD device and compiled
> the module, but I noticed that the module uses for (t=0; t <3000; t++) ;
> for sleeping which is not a good way to wait in the kernel, so I'd like
> to replace it. I tried usleep but that's a lib function so is unsuitable.
> The function is called thusly,
>
> static int lcd_write (struct inode *inode, struct file *file, const char
> *buf, int count)
I have done a lot of clean-ups on that code, I still have som trouble
to resolve conserning the 4-bit mode of the LCD display. But I think
it has gotten much better. I'm afraid the web page and documentation
(what little there is) is in Norwegian. If you need it I could translate
what you need. Take a look at : http://www.ifi.uio.no/~bjornr/linux/
There you will find the most recent version: lcd_drive-0.2.tgz.
BTW: I use the udelay() function to sleep...
--
BjørnR