Mail Archives: djgpp/1996/01/30/02:19:57
On Mon, 29 Jan 1996, Mark Lee wrote:
> while(read)
> {
> while(inportb(STATUS_PORT)) /* check DATA is beening sent */
> { /* read DATA and print */
> fprintf(stderr," DATA READ %d \n",inportb(DATA_PORT));
> }
> outportb(CONTROL_PORT,1); /* Send Stop Request */
> /* End reading */
> read=0;
> }
It seems that if `inportb(STATUS_PORT)' returns zero first time through
the `while(read)' loop (meaning probably that the other PC didn't write
anything yet), your program immediately sets `read' to zero and exits the
loop. I would add another loop (before `while(read)' one) which waits
for STATUS_PORT to go high until some timeout is reached, *then* enter
the `while(read)' loop.
- Raw text -