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

📄 main.c

📁 用于dm6467 开发平台的uboot源码
💻 C
字号:
/*
 *  Copyright 2007 by Spectrum Digital Incorporated.
 *  All rights reserved. Property of Spectrum Digital Incorporated.
 */

/*
 *  DaVinci HD Test Suite
 *
 */

#include "stdio.h"
#include "davincihd.h"

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  Testing Function                                                        *
 *                                                                          *
 * ------------------------------------------------------------------------ */
void TEST_execute( Int16 ( *funchandle )( ), char *testname, Int16 testid )
{
    Int16 status;

    /* Display test ID */
    printf( "%02d  Testing %s...\n", testid, testname );

    /* Call test function */
    status = funchandle( );

    /* Check for test fail */
    if ( status != 0 )
    {
        /* Print error message */
        printf( "     FAIL... error code %d... quitting\n", status );
    }
    else
    {
        /* Print error message */
        printf( "    PASS\n" );
    }
}

extern Int16 spirom_test();

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  main( )                                                                 *
 *                                                                          *
 * ------------------------------------------------------------------------ */
void main( void )
{
    TEST_execute( spirom_test,  "spirom", 1 );

    printf( "\n***ALL Tests Passed***\n" );
}

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  _wait( delay )                                                          *
 *      Wait in a software loop for 'x' delay                               *
 *                                                                          *
 * ------------------------------------------------------------------------ */
void DAVINCIHD_wait( Uint32 delay )
{
    volatile Uint32 i;
    for ( i = 0 ; i < delay ; i++ ){ };
}

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  _waitusec( usec )                                                       *
 *      Wait in a software loop for 'x' microseconds                        *
 *                                                                          *
 * ------------------------------------------------------------------------ */
void DAVINCIHD_waitusec( Uint32 usec )
{
    #ifdef ARM_SIDE
        DAVINCIHD_wait( usec * 2 );
    #elif DSP_SIDE
        DAVINCIHD_wait( usec * 28 );
    #endif
}

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  _waitmsec( msec )                                                       *
 *      Wait in a software loop for 'x' milliseconds                        *
 *                                                                          *
 * ------------------------------------------------------------------------ */
void DAVINCIHD_waitmsec( Uint32 msec )
{
    _waitusec( 1000 * msec );
}

⌨️ 快捷键说明

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