⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dss.c

📁 DSP6000,bios APPLICATIONS 源码程序
💻 C
字号:
/*
 *  Copyright 2000 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  U.S. Patent Nos. 5,283,900  5,392,448
 */
/* "@(#) DSP/BIOS 4.00 03-27-00 (barracuda-e08)" */
/*
 *  ======== dss.c ========
 */

#include <std.h>

#include <dss.h>
#include <pip.h>

Int     DSS_error = 0;

Int     DSS_rxCnt = 0;
Int     DSS_txCnt = 0;

#if defined (_62_)
Int     *DSS_rxPtr = NULL;
Int     *DSS_txPtr = NULL;
#else
Char    *DSS_rxPtr = NULL;
Char    *DSS_txPtr = NULL;
#endif

/*
 *  ======= DSS_txPrime ========
 */
void DSS_txPrime(void)
{
    PIP_Obj     *txPipe = &DSS_txPipe;
    static int delay = 1;       /* or 2, 3, etc. */
    static Int nested = 0;

    if (nested) {       /* prohibit recursive call via PIP_get() */
        return;
    }

    if (delay) {
        delay--;
        return;
    }

    nested = 1;

    if (DSS_txCnt == 0 && PIP_getReaderNumFrames(txPipe) > 0) {

        PIP_get(txPipe);

        DSS_txPtr = PIP_getReaderAddr(txPipe);/* must set 'Ptr' before 'Cnt' */
        DSS_txCnt = PIP_getReaderSize(txPipe);/* to synchronize with isr() */
    }

    nested = 0;
}

/*
 *  ======= DSS_rxPrime ========
 */
void DSS_rxPrime(void)
{
    PIP_Obj     *rxPipe = &DSS_rxPipe;
    static Int  nested = 0;

    if (nested) {       /* prohibit recursive call via PIP_alloc() */
        return;
    }

    nested = 1;

    if (DSS_rxCnt == 0 && PIP_getWriterNumFrames(rxPipe) > 0) {
        PIP_alloc(rxPipe);
        DSS_rxPtr = PIP_getWriterAddr(rxPipe);/* must set 'Ptr' before 'Cnt' */
        DSS_rxCnt = PIP_getWriterSize(rxPipe);/* to synchronize with isr() */
    }

    nested = 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -