www.pudn.com > ASYNC13.rar > BREAK.C


/* A module of ASYNCx.LIB version 1.02 */ 
 
#include  
#include "asyncdef.h" 
 
/************************************************/ 
/** turn on the BREAK signal for between count **/ 
/** and count+1 eighteenths of a second.       **/ 
/************************************************/ 
int a_break(ASYNC *p,int count) 
{unsigned long t0; 
 unsigned long far *t1; 
 byte lcr; 
 if (p) 
  {t1=(unsigned long far *)MK_FP(0x40,0x6c); 
   t0=*t1; 
   lcr=inportb(p->base+LCR); 
   outportb(p->base+LCR,lcr | 0x40); /* turn on the BREAK signal     */ 
   while(*(t1)-t0<=(long)count);     /* wait for count ticks to pass */ 
   outportb(p->base+LCR,lcr);        /* turn off the BREAK signal    */ 
   return 0; 
  } 
 return -1; 
} /* end of a_break(p,count) */