Re: [PARPORT] custom cabling

From: Nate Jenkins (nate@uniwest.com)
Date: Wed May 14 2003 - 13:55:47 EDT

  • Next message: Blaise Gassend: "Re: [PARPORT] custom cabling"

    I appreciate you looking at my code. I am pretty sure I am reading the
    respective ports, unless I am really missing something. The first time it I
    read the control port is in simreadonly.cpp line 41:
    ->->->-> else if( NOERRORS == pp.GetPort( atoi(argv[1]) ) )

    This function is defined in ModLapLinkInterface2.cpp line 28. GetPort reads
    the control port on line 100:
    ->->->-> READ_CTRL_REG();

    This macro is defined in the ModLapLinkInterface2.h file starting at line
    115 and ending at line 124:
    ->->->-> #define READ_CTRL_REG() if( ioctl( m_nPort, PPRCONTROL,
    &m_ucByte ) ) \

    However, I am repeatedly reading the control port in simreadonly.cpp line 51
    in the main loop:
    ->->->-> pp.GetC( &ucCTRL );

    The function GetC(...) is defined starting at line 167 in
    ModLapLinkInterface2.cpp where it also utilizes the aforementioned macro. I
    am using the macros so I can use the same code in DOS as well as Linux. So
    I wouldn't have to change the function definitions since they can call which
    ever version is defined. Its is not there yet because I would have to
    define the DOS equivelents and include respective headers based on which one
    I wanted to use.

    So am I missing something major here? Or is it any clearer than mud now?
    :)
    How shall I make use of your suggestion to "access the register to change
    the direction of the bits"?

    Thanks,
    Nate

    ----- Original Message -----
    From: "Blaise Gassend" <blaise@gassend.com>
    To: "Nate Jenkins" <nate@uniwest.com>
    Cc: "Parport" <linux-parport@torque.net>; "Gregg C Levine"
    <yodathejediknight@worldnet.att.net>
    Sent: Wednesday, May 14, 2003 5:59 AM
    Subject: Re: [PARPORT] custom cabling

    > Hi Nate,
    >
    > I had a look at your code, and it seems to me that you aren't accessing
    > the econtrol register at all. I believe that you have to do so to change
    > the direction of those bits. I've never done this via the ppdev
    > interface, so I can't give you any specifics, but I'm pretty sure this
    > is your problem.
    >
    > > I have the status port of PC #2 accepting bit changes from data port of
    > > PC #1. However, no matter what I do, I cannot change the values of the
    > > control port of PC #2 from outside of PC #2.
    >
    > -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    > -- with the single word "unsubscribe" in the body of the message. --
    >
    >

    -- 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 2b29 : Wed May 14 2003 - 14:03:27 EDT