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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sdc.c

?? Nucleus 移植到OMAP1610的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
            if(uart->com_port == SD_UART1)
            {
                /* Enable the UART interrupt globally */
                int_val = SD_INDWORD (ILR_BASE_2 + INT_MASK_OFFSET);
                int_val &= ~(UART_INT_A);
                SD_OUTDWORD(ILR_BASE_2 + INT_MASK_OFFSET, int_val);
            }
            else  /* Handle UART B */
            {    
                /* Enable the UART interrupt globally */
                int_val = SD_INDWORD (ILR_BASE_2 + INT_MASK_OFFSET);
                int_val &= ~(UART_INT_B);
                SD_OUTDWORD(ILR_BASE_2 + INT_MASK_OFFSET, int_val);
            }
            /* Set the serial port to UART mode */
            SD_OUTBYTE(uart->base_address + MDR_OFFSET, MDR_UART_MODE);

        }

        /************** End Port Specific Section *************/


        /* Initialize the error counters. */
        uart->parity_errors   =
        uart->frame_errors    =
        uart->overrun_errors  = 
        uart->busy_errors     = 
        uart->general_errors  = 0;

        /* Restore interrupts to previous level */
        NU_Local_Control_Interrupts(int_level);
    }

    return (status);
}
/***************************************************************************
* FUNCTION
*
*    SDC_Put_Char
*
* DESCRIPTION
*
*    This writes a character out to the serial port.
*
* INPUTS
*
*    UINT8 :   Character to to be written to the serial port.
*    SD_PORT *     :   Serial port to send the char to.
*
* OUTPUTS
*
*    none
*
****************************************************************************/
VOID  SDC_Put_Char(UINT8 ch, SD_PORT *uart)
{
INT         int_level;          /* old interrupt level */
UINT32  temp_long;

#ifdef GRAFIX_MOUSE
    if ((uart->communication_mode == SERIAL_MODE) ||
        (uart->communication_mode == SERIAL_MOUSE))
#else
    if (uart->communication_mode == SERIAL_MODE)
#endif

    {
        /* If the buffer is full wait for it to empty a little. */
        while (uart->tx_buffer_status == NU_BUFFER_FULL);

        /* Disable interrupts */
        int_level = NU_Local_Control_Interrupts(NU_DISABLE_INTERRUPTS);

        /* Check the transmit buffer status. If it has data already
           just add this byte to the buffer. */
         if ( uart->tx_buffer_status != NU_BUFFER_EMPTY)
        {
            /* Add byte to buffer. */
            uart->tx_buffer[uart->tx_buffer_write++] = ch;

            /* Check for wrap of buffer. */
            if(uart->tx_buffer_write == uart->sd_buffer_size)
                uart->tx_buffer_write = 0;
          
            /* Check for full buffer. */
            if (uart->tx_buffer_write == uart->tx_buffer_read) 
                uart->tx_buffer_status = NU_BUFFER_FULL;

            /* Restore interrupts to previous level */
            NU_Local_Control_Interrupts(int_level);
        }
        else
        {
            /* Otherwise send the data. */

            /* Restore interrupts to previous level */
            NU_Local_Control_Interrupts(int_level);

            /* Add byte to buffer. */
            uart->tx_buffer[uart->tx_buffer_write++] = ch;

            /* Check for wrap of buffer. */
            if(uart->tx_buffer_write == uart->sd_buffer_size)
                uart->tx_buffer_write = 0;
             
            /* Set status */
            uart->tx_buffer_status = NU_BUFFER_DATA;

            /**************** Begin Port Specific Section **************/

            /* Wait until the transmitter buffer is empty */
            while (!(SD_INBYTE (uart->base_address + LSR_OFFSET) & LSR_TX_HOLD_EMPTY));

            /* Transmit the character */
            SD_OUTBYTE (uart->base_address + THR_OFFSET, ch);

            /* Enable the TX interrupts */
            temp_long = SD_INBYTE (uart->base_address + IER_OFFSET);
            temp_long |= IER_TX_HOLDING_REG;
            SD_OUTBYTE (uart->base_address + IER_OFFSET, temp_long);               

        }
    
    }  /* endif mode */
    else 
    {
        /* Wait until the transmitter buffer is empty */
        while (!(SD_INBYTE (uart->base_address + LSR_OFFSET) & LSR_TX_HOLD_EMPTY));

        /* Transmit the character */
          SD_OUTBYTE (uart->base_address + THR_OFFSET, ch);

#ifndef PPP_POLLED_TX

            /* Enable the TX interrupts */
            temp_long = SD_INBYTE (uart->base_address + IER_OFFSET);
            temp_long |= IER_TX_HOLDING_REG;
            SD_OUTBYTE (uart->base_address + IER_OFFSET, temp_long);
                 
#endif /* PPP_POLLED_TX */


    }

        /***************** End Port Specific Section ***************/

}

/***************************************************************************
* FUNCTION
*
*    SDC_LISR
*
* DESCRIPTION
*
*    This is the entry function for the receive ISR that services the UART
*    in the ARM925.
*
* INPUTS
*
*    INT         :   Interrupt vector
*
* OUTPUTS
*
*    none
*
****************************************************************************/
VOID  SDC_LISR(INT vector)
{

SD_PORT         *uart;
CHAR            receive;
UINT8           status;
UINT8           int_status;
UINT8           vector_found = NU_FALSE;
UINT8           ier_val;


#ifdef NU_ENABLE_PPP
DV_DEVICE_ENTRY *device;
#endif /* NU_ENABLE_PPP */

    for(receive = 0 ; (SDC_Port_List[receive] != NU_NULL) &&
        (receive < SD_MAX_UARTS) && !vector_found ; receive++)
    {
        /* See if we found one. Better have since we got an interrupt
           from one. */
        if (SDC_Port_List[receive] -> vector == vector)
        {
            /* Point our local structure to it. */
            uart = SDC_Port_List[receive];
            vector_found = NU_TRUE;
        }
    }

#ifdef  NU_ENABLE_PPP

    /* Find the device for this interrupt */
    if ( (device = DEV_Get_Dev_For_Vector(vector)) != NU_NULL)
    {
        /* Get the address of the uart structure for this device. */ 
        uart = &((PPP_LAYER *) device->ppp_layer)->uart;
        vector_found = NU_TRUE;    
    }

#endif /* NU_ENABLE_PPP */
    
    if (vector_found == NU_TRUE)
    {
        /**************** Begin Port Specific Section **************/

        /* Get the interrupt status register value */
        int_status = SD_INBYTE(uart->base_address + IIR_OFFSET);

        /* Loop until all interrupts are processed */
        while (!(int_status & IIR_PENDING))
        {
            /* Check for a receive interrupt */
            if (((int_status & IIR_RX_LINE_STAT) ==IIR_RX_LINE_STAT) ||
                ((int_status & IIR_RX_RDY) ==IIR_RX_RDY) ||
                ((int_status & IIR_RX_TIMEOUT) ==IIR_RX_TIMEOUT) )
            {
               /* Process every character in the receive FIFO */
                status = SD_INBYTE(uart->base_address + LSR_OFFSET);

                while (status & LSR_RX_DATA_READY)
                {
                    /* Get character from receive FIFO */
                    receive = SD_INBYTE (uart->base_address + RHR_OFFSET);

                    /* Check if receive character has errors */
                    if (status & (LSR_FRAMING_ERROR | LSR_PARITY_ERROR))
                    {
                        /* Increment parity errors if necessary */
                        uart->parity_errors += ((status & LSR_PARITY_ERROR) == LSR_PARITY_ERROR);

                        /* Increment framing errors if necessary */
                        uart->frame_errors += ((status & LSR_FRAMING_ERROR) == LSR_FRAMING_ERROR);
                    }
                    else    // no framing or parity errors
                    {
                        /* Increment overrun errors if necessary */
                        uart->overrun_errors += ((status & LSR_RX_DATA_READY) == LSR_RX_DATA_READY);

                        /* Switch based on UART mode */
                        switch(uart->communication_mode)
                        {
                            case SERIAL_MODE: 

                                if (uart->rx_buffer_status != NU_BUFFER_FULL)
                                {
                
                                    /* Put the character into the buffer */
                                    uart->rx_buffer[uart->rx_buffer_write++] = receive;

                                    /* Check for wrap of buffer. */
                                    if(uart->rx_buffer_write == uart->sd_buffer_size)
                                        uart->rx_buffer_write = 0;
                                    
                                    /* Set status field based on latest character */
                                    if (uart->rx_buffer_write == uart->rx_buffer_read)
                                        uart->rx_buffer_status = NU_BUFFER_FULL;
                                    else
                                        uart->rx_buffer_status = NU_BUFFER_DATA;
                                }
                                else
                                    uart->busy_errors++;

                            break;
                    
#ifdef NU_ENABLE_PPP
                            /* call PPP processing functions */

                            case MDM_NETWORK_COMMUNICATION:
                                /* Call this devices receive routine */
                                device->dev_receive(device);
                            break;

                            case MDM_TERMINAL_COMMUNICATION:
                            default:
                                MDM_Receive(device);
                            break;
#endif /* NU_ENABLE_PPP */
                        } 
                    }

                    /* Check the rx buffer status again... */
                    status = SD_INBYTE(uart->base_address + LSR_OFFSET);

                }

            }   // if ((status & IIR_TYPE_MASK) == IIR_Rx_Rdy)


            int_status = SD_INBYTE(uart->base_address + IER_OFFSET);

            if (int_status & IER_TX_HOLDING_REG)
            {
               if (uart->communication_mode == SERIAL_MODE)
                {    
                    /* Bump the read pointer past the byte that was just
                       transmitted. */
                    ++(uart->tx_buffer_read);
                
                    /* Check for wrap of buffer. */
                    if(uart->tx_buffer_read == uart->sd_buffer_size)
                        uart->tx_buffer_read = 0;

                    /* Update the status. */
                    if (uart->tx_buffer_write == uart->tx_buffer_read)
                    {
                       uart->tx_buffer_status = NU_BUFFER_EMPTY;

                        /* Since it is now empty disable the TX interrupt! */
                        ier_val =  SD_INBYTE(uart->base_address + IER_OFFSET);
                        ier_val &= ~IER_TX_HOLDING_REG;
                        SD_OUTBYTE(uart->base_address + IER_OFFSET, ier_val);
                    }
                    else
                    {

                        /* Wait until the transmitter buffer is empty */
                        while (!(SD_INBYTE (uart->base_address + LSR_OFFSET) & LSR_TX_HOLD_EMPTY));

                        /* Send the next byte in the queue. */
                        SD_OUTBYTE(uart->base_address + THR_OFFSET, uart->tx_buffer[uart->tx_buffer_read]);
                        
                        /* Update the status. */
                        uart->tx_buffer_status = NU_BUFFER_DATA;
                    }
                }
#ifdef NU_ENABLE_PPP
               else
                {
#ifndef PPP_POLLED_TX
                   /* Check for a transmit interrupt. */
                   /* Is there another byte in the TX buffer to send? */
                   if (uart->tx_buffer_read != uart->tx_buffer_write)
                   {
                        /* Wait until the transmitter buffer is empty */
                        while (!(SD_INBYTE (uart->base_address + LSR_OFFSET) & LSR_TX_HOLD_EMPTY));

                        /* Send the next byte in the queue. */
                        SD_OUTBYTE (uart->base_address + THR_OFFSET, uart->tx_buffer[uart->tx_buffer_read++]); 
                        
                        /* Check for wrap of buffer. */
                        uart->tx_buffer_read %= uart->sd_buffer_size;
                   }
                   else
                   {
                   
                        /* Since it is now empty disable the TX interrupt! */
                        ier_val =  SD_INBYTE (uart->base_address + IER_OFFSET);
                        ier_val &= ~IER_TX_HOLDING_REG;
                        SD_OUTBYTE (uart->base_address + IER_OFFSET, ier_val);

                       /* Only activate the HISR if we are tranmitting
                          network data. */
                       if (uart->communication_mode == MDM_NETWORK_COMMUNICATION)
                       {
                            /* Add this device to the list of PPP devices that have finished
                               sending a packet. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品主播直播| 久久九九久久九九| 久久av资源网| 亚洲色图清纯唯美| 精品福利在线导航| 欧美性猛片aaaaaaa做受| 老司机午夜精品| 一区二区三区小说| 日本一区二区三区四区| 538在线一区二区精品国产| av在线不卡网| 国产麻豆一精品一av一免费| 亚洲地区一二三色| 国产精品久久久久四虎| 精品国产乱码久久久久久影片| 欧洲国产伦久久久久久久| thepron国产精品| 国产伦精品一区二区三区免费| 天天综合天天做天天综合| 亚洲人成在线观看一区二区| 国产日产欧美一区| 精品日本一线二线三线不卡| 69堂成人精品免费视频| 91久久一区二区| 99这里只有久久精品视频| 国产乱码精品1区2区3区| 免费看精品久久片| 日韩精品欧美精品| 性久久久久久久| 亚洲午夜一区二区| 亚洲一区在线观看视频| 1区2区3区欧美| 中文字幕在线一区| 中文字幕视频一区| 亚洲欧洲精品成人久久奇米网| 日本一区二区视频在线观看| 久久97超碰国产精品超碰| 日韩影院精彩在线| 日韩精品91亚洲二区在线观看| 亚洲bdsm女犯bdsm网站| 亚洲自拍都市欧美小说| 一区二区三区四区视频精品免费| 亚洲三级免费观看| 一区二区不卡在线视频 午夜欧美不卡在| 欧美激情一区二区三区四区| 国产蜜臀97一区二区三区| 国产精品久久毛片av大全日韩| 久久精品一区二区三区不卡| 久久九九影视网| 国产精品国产三级国产aⅴ无密码| 国产精品午夜久久| 亚洲色图欧洲色图| 亚洲一区影音先锋| 日韩影视精彩在线| 黄色日韩网站视频| 成人一道本在线| 91丨porny丨在线| 欧美性受xxxx黑人xyx| 欧美丰满一区二区免费视频| 91精品国产福利| 精品人在线二区三区| 国产精品人成在线观看免费| 亚洲视频你懂的| 亚洲韩国一区二区三区| 日韩国产精品久久久| 精品一区二区久久| 成人免费福利片| 欧美在线999| 欧美成人官网二区| 国产精品欧美一区喷水| 亚洲综合在线五月| 日韩va欧美va亚洲va久久| 精品一区二区三区在线视频| 成人综合婷婷国产精品久久免费| 91视频.com| 日韩一二三区视频| 欧美激情在线一区二区| 亚洲自拍偷拍图区| 国产精品一线二线三线精华| 一本久久综合亚洲鲁鲁五月天| 777精品伊人久久久久大香线蕉| 久久只精品国产| 一区二区三区在线播放| 国产一区啦啦啦在线观看| 色老汉av一区二区三区| 精品少妇一区二区三区免费观看 | 日本午夜精品视频在线观看 | 欧美日韩在线直播| 26uuu久久天堂性欧美| 最新成人av在线| 老司机免费视频一区二区| 菠萝蜜视频在线观看一区| 欧美顶级少妇做爰| 欧美国产亚洲另类动漫| 欧美大胆人体bbbb| 蜜桃久久久久久久| 色综合色狠狠天天综合色| 日韩午夜av电影| 亚洲一区二区高清| 久久久综合激的五月天| 欧美国产日产图区| 男人的j进女人的j一区| 99精品视频一区| 欧美三级在线看| 日韩视频中午一区| 免费亚洲电影在线| 色系网站成人免费| 精品视频在线看| 国产精品情趣视频| 久久这里都是精品| 蜜臀av性久久久久蜜臀av麻豆 | 国产·精品毛片| 老司机精品视频线观看86| 国产精品区一区二区三| 日韩午夜精品电影| 色一区在线观看| 天堂在线亚洲视频| 亚洲风情在线资源站| 在线观看亚洲精品视频| 色婷婷亚洲精品| 色婷婷亚洲精品| 色婷婷av一区二区三区软件| caoporen国产精品视频| 成人av影院在线| 91在线视频免费观看| 色婷婷亚洲精品| 欧美三级欧美一级| 欧美二区三区91| 666欧美在线视频| 日韩女优毛片在线| 国产午夜精品一区二区三区视频 | 欧美色图激情小说| 欧美三级乱人伦电影| 日韩美女一区二区三区四区| 欧美色欧美亚洲另类二区| 久久亚洲二区三区| 亚洲一区二区三区四区在线| 不卡的av在线| 欧洲精品中文字幕| 91免费看视频| 一本高清dvd不卡在线观看| 欧洲国内综合视频| 精品av久久707| **欧美大码日韩| 国产一区二区三区四区在线观看| 91国内精品野花午夜精品| 国产精品久久久久四虎| 韩国三级在线一区| 欧美日韩国产成人在线91| 国产精品亲子乱子伦xxxx裸| 日韩精品欧美精品| 国产成人免费xxxxxxxx| 波多野结衣中文字幕一区| 91国产丝袜在线播放| 国产成人av福利| 91黄视频在线| 欧美日韩国产综合久久| 久久这里只精品最新地址| 日韩av成人高清| 中文无字幕一区二区三区| 69久久夜色精品国产69蝌蚪网| 国产成人一区二区精品非洲| 久久久久9999亚洲精品| 亚洲一区二区三区四区五区中文 | 欧美日韩一区在线观看| 欧美一区二区在线观看| 激情欧美日韩一区二区| 欧美日韩国产影片| 国产精品欧美久久久久无广告| 日韩一区有码在线| 黄色日韩三级电影| 91精品国产综合久久精品图片 | 免费看日韩a级影片| 白白色 亚洲乱淫| 国产日韩精品一区二区三区在线| 香蕉久久夜色精品国产使用方法 | 综合自拍亚洲综合图不卡区| 亚洲成av人片在线观看| av在线不卡电影| 亚洲电影激情视频网站| 4438成人网| 蜜桃视频第一区免费观看| 91麻豆精品91久久久久久清纯 | 国产精品天干天干在线综合| 色偷偷成人一区二区三区91 | 1区2区3区欧美| 国产精品成人免费| 午夜成人免费电影| 色诱视频网站一区| 欧美激情一区二区三区蜜桃视频| 蜜臀av亚洲一区中文字幕| 欧美色欧美亚洲另类二区| 亚洲欧洲成人精品av97| 成人免费视频caoporn| 欧美精品一区二区三| 蜜桃视频在线观看一区| 日韩色视频在线观看| ...xxx性欧美| 中文字幕精品一区二区三区精品| 国产剧情在线观看一区二区|