Re: [PARPORT] ECP mode in 2.3


Tim Waugh (twaugh@redhat.com)
Tue, 16 Nov 1999 05:39:22 -0500 (EST)


On Mon, 15 Nov 1999, Darren wrote:

> I thought the parport should be doing the strobe lines in hardware,
> what am I doing wrong here? any advice?

Yes, it will do the handshake in hardware if you tell it to, but that's
not what you've done. I know that there is no documentation for ppdev or
parport, and it's something I'm working on now.

Here's what you need to change:

> char *str, *c;
> [...]
> strcpy(str, "Hello World\n");

You probably meant const char *str = "Hello World\n" here.

> for(i=0;i<1000;i++){
> for (; str; str++){
> if (ioctl (fd, PPWDATA, &str)) {
> printf ("Couldn't write data\n");
> return 1;
> }

Instead of this loop you want:

    write (fd, str, strlen (str));

By the way, the PPCLAIM after the PPEXCL _is_ necessary: PPEXCL just means
that when you claim, you will want exclusive access. It doesn't claim
right away.

Does that help?

Tim.
*/

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Tue 16 Nov 1999 - 05:41:08 EST