亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? serdpcin.c

?? 一個(gè)C語(yǔ)言寫(xiě)的讀入位置跟蹤器數(shù)據(jù)的源程序
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
	}
	else    /* rxcount > 0 */
	{
	    /*
		Get remainder of Block of data from the serial port, recsize characters
		and store them in rxbuf
	    */
	    if ((rxchar = waitforchar()) >= 0)  /* no errors */
	    {
		/*
		   Check Phase bit
		*/
		if (rxchar & 0x80)              /* check to see that phase bit = '0' */
		{
		    if (outputmode == STREAM)
		    {
			phaseerror_count++;     /* keep track of phase errors */
			resynch = TRUE;         /* loop again flag */
			continue;
		    }
		    else
		    {
			return(RXPHASEERROR);       /* return phase error */
		    }
		}
	    }
	    else
	    {
		if (outputmode == STREAM)
		{
		    phaseerror_count++;     /* keep track of phase errors */
		    resynch = TRUE;         /* loop again flag */
		    continue;
		}
		else
		{              
		    return(RXERRORS);
		}
	    }
	}
	/*
	   Store the received character
	*/
	*rxbufptr++ = rxchar;   /* store and adjust pointer */
	rxcount++;              /* increment */
    }
    while ((resynch) || (rxcount < recsize));

    /*
	Return the number of characters received
    */
    return(rxcount);
}

/*
    send_serial_cmd     -    Send Serial Command to the Bird port

    Prototype in:       serial.h

    Parameters Passed:  cmd         -   string to send to the serial point
			cmdsize     -   size of the cmd string (cmd is NOT
					NULL terminated, since the data can
					be NULL)
    Return Value:       number of characters transmitted

    Remarks:            Routine will send a string of characters to the serial
			port.  The string is pointed to by cmd and all
			characters will be sent upto but NOT including
			the NULL
*/
int send_serial_cmd(cmd,cmdsize)
unsigned char * cmd;
short cmdsize;
{
    short txcount = 0;
    unsigned char rs232tofbbcmd;

    DISABLE();

    /*
	Send the RS232 to FBB Prefice Character if non-zero
    */
    if (rs232tofbbaddr > 0)
    {
	if (rs232tofbbaddr <= 15)
	    /* pass through command 0-15 */
	    rs232tofbbcmd = (unsigned char)(0xF0 | rs232tofbbaddr);
	else
	    /* pass through command 16-31 */
	    rs232tofbbcmd = (unsigned char)(0xE0 | rs232tofbbaddr-16);

	while (send_serial_char(rs232tofbbcmd) == TXNOTEMPTY);
    }

    while (txcount < cmdsize)
    {
	/*
	    Store the character in the TX buffer
	*/
	if (send_serial_char(*cmd++) != TRUE)
	    break;

	txcount++;
    }

    /*
	Verify that the TX interrupt is enabled
	..if not, enable it so that the ISR will execute
    */
    if ((INPORTB (com_base + INTERENABLE) & TXHOLDINTENABLE) == 0)
    {
	OUTPORTB (com_base + INTERENABLE,
	    TXHOLDINTENABLE | RXDATAAVAILINTENABLE | RXLINESTATUSINTENABLE);
	OUTPORTB (com_base + INTERENABLE,
	    TXHOLDINTENABLE | RXDATAAVAILINTENABLE | RXLINESTATUSINTENABLE);
    }
    ENABLE();                   /* reenable interrupts */
    return(txcount);
}

/*
    send_serial_char    -   Send one serial char to the serial port

    Prototype in:       serial.h

    Parameters Passed:  chr     -   character to send to the serial port

    Return Value:       returns TRUE if successful, or TXBUFFERFULL if the
			TXBUF is full

    Remarks:            The routine is used to send a single character
			out to the UART if there is room in the output buffer.
			The routine checks to see if the Transmit interrupts
			are presently enabled...if not they are turned out
			so the ISR will get the character.
*/
int send_serial_char(chr)
unsigned char chr;
{
    /*
	Check for a full TX buffer...
	... 2 ways the txbufinptr can = the txbufoutptr:
		1) if the buffer is empty, which is OK
		2) if the buffer is full, which is not OK
    */
    if (txbufinptr == txbufoutptr)
	if (!txbufempty)
	    return(TXBUFFERFULL);

    /*
	Write the character to the inbufptr
    */
    *txbufinptr++ = chr;
    txbufempty = FALSE;

    /*
	Check for buffer end...wrap around if at end
    */
    if (txbufinptr == &txbuf[TXBUFSIZE])
	txbufinptr = txbuf;

    return(TRUE);
}

/*
    get_serial_char -   Get 1 Character from the serial port if one is available

    Prototype in:       serial.h

    Parameters Passed:  void

    Return Value:       returns the

    Remarks:            returns the receive character if successful,
			RXERRORS if recieve errors
			NODATAAVAIL if no characer available
*/
int get_serial_char()
{
	short rxchar;

    if ((!rxerrors) && (!rxbufoverruns))
    {
	/*
	    get character if available...else return
	*/
	if (rxbufinptr == rxbufoutptr)
	    return(NODATAAVAIL);

	/*
	    get the character
	*/
	rxchar = *rxbufoutptr++;

	/*
	    check for End of Rx buffer..if so, wrap pointer to start
	*/
	if (rxbufoutptr == &rxbuf[RXBUFSIZE])
	    rxbufoutptr = rxbuf;

	/*
	    return the character
	*/
	return(rxchar);
    }
    else
    {
	/*
	    Reset Error flags and Announce the Errors
	*/
	if (rxerrors)
	{
	    printf("** ERROR ** rx line errors have occured\n");
	    rxerrors = FALSE;
	}

	if (rxbufoverruns)
	{
	   printf("** ERROR ** rx buffer overrun errors have occured\n");
	   rxbufoverruns = FALSE;
	}

	return(RXERRORS);
    }

}

/*
    waitforchar         -   Wait for a Character from the Serial Port

    Prototype in:       serial.h

    Parameters Passed:  void

    Return Value:       returns the receive character if successful,
			RXERRORS if recieve errors,
			RXTIMEOUT if a time out occurs before a
			character is ready

    Remarks:            Routine waits for the TIMEOUTINTICKS period
			for a character

*/
int waitforchar()
{
	short rxchar;
    long starttime;

    /*
	Get the time now in ticks
    */
    starttime = GETTICKS;

    /*          
	Wait until a character is available
	....leave loop if errors or character available
    */
    while ((rxchar = get_serial_char()) == NODATAAVAIL)
    {
	/*
	    Check to see if a timeout occured
	*/
	if ((GETTICKS - starttime) > (long)((RXTIMEOUTINSECS * 1000) / TICK_MSECS))
	{
	    printf("\n** ERROR ** receiver timed out\n");
	    return(RXTIMEOUT);
	}
    }


    /*
	return if RX errors
    */
    if (rxchar < 0)
	return(RXERRORS);

    /*
	Everything is OK...return the character
    */
    return(rxchar);
}

/*
    waitforphase        -   Wait for a Character with phase bit set

    Prototype in:       serial.h

    Parameters Passed:  void

    Return Value:       returns the received character if successful,
			or RXERRORS if an error occurs

    Remarks:            waits for a character to be received with the
			most significant bit (bit 7) set to a '1'.  Characters
			received with bit 7 = '0' are thrown away.
			Routine waits for the TIMEOUTINTICKS period.
*/
int waitforphase()
{
	short rxchar;

    /*
	Wait until waitforchar returns a character or error
    */
    while (((rxchar = waitforchar()) & 0x80) == 0)
    {
	/*
	    return if errors
	*/
	if (rxchar < 0)
	    return(RXERRORS);
    }

    /*
	Everything is OK...return the character
    */
    return(rxchar);
}


/*
    serialisr   -   Serial Interrupt Service Routine

    Prototype in:       serial.h

    Parameters Passed:  void

    Return Value:       void

    Remarks:            Routine processes the interrupt request from the
			8250 UART.  There are four possible interrupts from
			the UART...all are processed while in the ISR.
			Note that for the HIGHC users, the routine is
			called from the assembly module, which has
			set the DS to our own Data Segment, which will
			allow DOS to be interruptable since DOS will be
			operating in REAL mode via the DOS Extender
*/
#ifdef HIGHC
void serialisr(void)  /* called from the assembly code */
#else
INTTYPE serialisr()
#endif
{
	short intid;      /* holds the interrupt ID from the UART */
	short txchar;     /* Character to transmit */

#ifndef DPMC
    ENABLE();         /* enable higher priority interrupts to occur */
#endif

    /*
	Verify that the Interrupt is from the UART
	...do all the possible pending interrupts while here...until
	there are NO interrupts pending
    */

    while (!((intid = INPORTB(com_base + INTERIDENT)) & 1)) /* bit 0 = 0 if interrupts pending */
    {
	/*
	    Do the Serial Interrupt in Priority order
	    ..RXLINESTATUS, RXDATAAVAIL,TXEMPTY, MODEMSTATUS
	*/
	switch (intid)
	{
	    /*
		Line Status
		...just increment error counter
	    */
	    case RXLINESTATUS:  /* line status changed ... check RX errors */
		/*
		    Get the error from Linestatus
		*/
		if ((rxerrorvalue = (INPORTB(com_base + LINESTATUS) & RXERRORMSK)) != 0) /* clears interrupt */
		    rxerrors = TRUE;

		break;

	    /*
		RX Data Available
		...get the byte and store it in the RX circular buffer
		.....check for RX buffer overruns when storing character
	    */
	    case RXDATAAVAIL:
		/*
		    Get the RX data and store in the circular buffer
		*/
		*rxbufinptr++ = INPORTB(com_base + RXBUF);

		/*
		    Check for RX circular buffer overrun
		*/
		if (rxbufinptr == rxbufoutptr)          /* ck overrrun? */
		    rxbufoverruns=TRUE;                 /* increment overrun count */

		/*
		    Check for top of buffer...adjust if necessary
		*/
		if (rxbufinptr == &rxbuf[RXBUFSIZE])    /* at top ? */
		    rxbufinptr = rxbuf;                 /* reset */

		break;

	    /*
		TX Holding Register Empty
		...transmit a character from the TX buffer if one is available
		else, shut down the TX interrupt until more characters are
		available
	    */
	    case TXEMPTY:
		/*
		    Get the Character to transmit
		*/
		txchar = *txbufoutptr++;

		/*
		    check for top of buffer
		    ...reset if at top
		*/
		if (txbufoutptr == &txbuf[TXBUFSIZE])
		    txbufoutptr = txbuf;

		if (txbufoutptr == txbufinptr)          /* no data to send */
		{
		    /*
			Disable the Tx Interrupt Enable
			....don't bother until more TX chars in buffer
		    */
		    OUTPORTB(com_base + INTERENABLE,
			RXDATAAVAILINTENABLE | RXLINESTATUSINTENABLE);
		    OUTPORTB(com_base + INTERENABLE,
			RXDATAAVAILINTENABLE | RXLINESTATUSINTENABLE);

		    /*
			Set flag to indicate buffer empty
		    */
		    txbufempty = TRUE;
		}
		/*
		    Send the next TX character and increment the pointer
		*/
		OUTPORTB(com_base + TXBUF, txchar);

		break;

	    /*
		Modem Status Change
		...currently should never get here since it is never enabled,
		but if we do...clear the request by reading the register
	    */
	    case MODEMSTATUSCHG:        /* CTS, DSR, RI, DCD change */
	       INPORTB(com_base + MODEMSTATUS);         /* clear the request */
	}
    }

    /*
	Send End of Interrupt Command to the 8259
    */
    PCPIC_OUTEOI;

    return;         /* go home via IRET */
}

#endif      /* DOS */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费在线观看不卡| 欧美高清dvd| 成人av免费在线播放| 国产成人免费视频| 国产成人免费在线视频| 国产传媒久久文化传媒| 国产精品18久久久久久久网站| 韩国欧美一区二区| 狠狠色丁香久久婷婷综合丁香| 久久国产精品99精品国产| 久久99国产精品免费| 国产精品888| eeuss鲁片一区二区三区| 91视频一区二区| 欧美性猛交xxxx黑人交 | 日韩美女在线视频 | 亚洲国产欧美在线人成| 亚洲精品中文字幕乱码三区| 亚洲最新视频在线播放| 亚洲精品一二三| 日韩高清一级片| 精品亚洲国产成人av制服丝袜| 国产一区二三区| 99在线精品观看| 欧美日韩综合色| 精品少妇一区二区三区免费观看| 国产日韩亚洲欧美综合| 亚洲卡通欧美制服中文| 日本人妖一区二区| 东方aⅴ免费观看久久av| 色婷婷av一区| 日韩欧美一区二区久久婷婷| 久久精品视频一区二区三区| 亚洲激情成人在线| 美国毛片一区二区三区| 成人黄色av电影| 欧美日韩精品一区二区三区四区| 精品国免费一区二区三区| 中文字幕一区二区三区av| 亚洲一区二区三区在线播放| 蜜臀国产一区二区三区在线播放| 国产黄色91视频| 欧美日韩专区在线| 日本一区二区三区久久久久久久久不 | 亚洲一区二区3| 日韩一级免费观看| √…a在线天堂一区| 午夜精品福利一区二区三区av| 国产一区二区剧情av在线| 91福利在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 日韩视频免费观看高清在线视频| 久久精品亚洲麻豆av一区二区| 亚洲午夜精品一区二区三区他趣| 精品制服美女久久| 在线观看一区日韩| 国产日韩亚洲欧美综合| 五月天亚洲婷婷| 91尤物视频在线观看| 欧美大尺度电影在线| 亚洲老妇xxxxxx| 国产99久久久精品| 欧美日韩精品三区| 亚洲人精品午夜| 国产乱一区二区| 欧美一区2区视频在线观看| 最近日韩中文字幕| 高潮精品一区videoshd| 欧美一区二区三区免费大片 | 99久久精品国产毛片| 欧美精品一区视频| 婷婷久久综合九色综合伊人色| 国产69精品久久久久777| 在线电影欧美成精品| 一区二区三区在线视频播放| 国产高清不卡二三区| 日韩精品资源二区在线| 亚洲成人综合视频| 91老师片黄在线观看| 日本一区二区三区国色天香 | 99久久久精品| 国产日韩欧美一区二区三区综合| 日韩激情视频在线观看| 欧美性大战久久久| 亚洲色图色小说| 成人精品高清在线| 久久午夜羞羞影院免费观看| 美日韩一级片在线观看| 7799精品视频| 亚洲va天堂va国产va久| 在线观看一区二区视频| 一区二区三区四区精品在线视频| aaa欧美大片| 中文字幕一区在线| 99re这里只有精品首页| 中文字幕一区二区不卡| 国产成人h网站| 欧美国产在线观看| 国产91高潮流白浆在线麻豆| 国产日韩欧美高清| 高清在线不卡av| 国产精品欧美一区喷水| 成人美女视频在线观看18| 国产精品久久久99| 91色九色蝌蚪| 亚洲视频综合在线| 欧美伊人精品成人久久综合97| 一卡二卡欧美日韩| 欧美无砖砖区免费| 亚洲福利电影网| 欧美顶级少妇做爰| 韩国成人精品a∨在线观看| 2020日本不卡一区二区视频| 国产suv精品一区二区6| 亚洲国产精品99久久久久久久久| 99九九99九九九视频精品| 亚洲黄色尤物视频| 欧美日韩卡一卡二| 激情欧美一区二区三区在线观看| 2020国产精品自拍| 91首页免费视频| 一级精品视频在线观看宜春院| 欧美精品 国产精品| 蜜臀av一区二区在线免费观看| 欧美精品一区二区久久久| 国产寡妇亲子伦一区二区| 亚洲人成精品久久久久久| 欧美疯狂性受xxxxx喷水图片| 久久99国产精品尤物| 国产精品成人免费在线| 欧美日韩色综合| 精品午夜久久福利影院| 国产精品久久久久久久久快鸭| 色天使色偷偷av一区二区| 五月激情丁香一区二区三区| 久久久蜜桃精品| 91福利在线看| 国模一区二区三区白浆| 亚洲黄色性网站| 精品国精品国产| 色偷偷久久一区二区三区| 美腿丝袜亚洲色图| 亚洲欧洲精品一区二区三区不卡| 欧美色图第一页| 国产一区二区三区最好精华液| 亚洲视频在线一区二区| 日韩欧美高清dvd碟片| 成人97人人超碰人人99| 日韩成人精品在线观看| 国产精品日日摸夜夜摸av| 91精品在线观看入口| 风间由美一区二区三区在线观看| 亚洲国产精品精华液网站| 久久久久久久久伊人| 欧美日韩在线播放| 成人免费福利片| 麻豆国产一区二区| 亚洲另类一区二区| 国产日本欧美一区二区| 666欧美在线视频| 成人av午夜影院| 极品销魂美女一区二区三区| 亚洲永久免费视频| 亚洲国产岛国毛片在线| 这里只有精品视频在线观看| 91在线porny国产在线看| 黑人巨大精品欧美黑白配亚洲| 亚洲综合免费观看高清在线观看| 久久精品在线观看| 91精品国产欧美日韩| 91精品福利视频| 成人免费av网站| 国产乱码精品一区二区三区忘忧草| 亚洲成人精品在线观看| 1区2区3区精品视频| 久久综合九色综合欧美亚洲| 欧美精品自拍偷拍动漫精品| 一本色道亚洲精品aⅴ| 成人久久久精品乱码一区二区三区| 久久精品国产一区二区| 午夜精品久久久久久久久久久| 国产精品欧美经典| www激情久久| 精品国产伦理网| 欧美一级一区二区| 欧美日本一区二区| 在线观看视频欧美| 一本到高清视频免费精品| 国产自产高清不卡| 精品一区二区精品| 看片网站欧美日韩| 久久er99精品| 久久国产精品无码网站| 美女视频一区二区| 日韩国产一二三区| 日韩精品乱码av一区二区| 亚洲一区成人在线| 亚洲成人福利片| 偷拍一区二区三区四区| 丝袜美腿亚洲一区|