processorversion_test.c

来自「ADI 公司的DSP ADSP21262 EZ-KIT LITE开发板的全部源代」· C语言 代码 · 共 55 行

C
55
字号
/*****************************************************************************
**																			**
**	 Name: 	ProcessorVersion.c											    **
**																			**
******************************************************************************

(C) Copyright 2004 - Analog Devices, Inc.  All rights reserved.

Pjoject Name:	21262 POST

Date Modified:	01Sept05	Ver 0.0

Software:		VisualDSP++ 4.5

Hardware:		ADSP-21262 EZ-KIT Lite

Connections:

Purpose:		To test the processor version agaisnt the software build

*****************************************************************************/
#include <cdef21262.h>

//--------------------------------------------------------------------------//
// Function:	int TestVersion(void)										//
//																			//
// Parameters:	None														//
//																			//
// Return:		0 indicates a failure - the processor does not match the    //
//				  version the software was built for                        //
//				1 indicates a pass - the processor and software versions    //
//				  both match                                                //
//																			//
// Description:	This function compares the version of the processor being   //
//              run on with the version that the software was built against //
//                                                                          //
// Purpose:		The reason for this test is because the build tools work-   //
//              around various silicon anomalies, by not checking to see    //
//              if the software is built for this particular processor      //
//              version, a risk that an anomaly will not be worked around   //
//              correctly.
//--------------------------------------------------------------------------//
int TEST_VERSION(void)
{
    int rev = *pREVPID>>4 ;	// bit 4-7 is silicon revision

	if( rev < 1 )
	{
	    //only 0.1 silicon and above is supported
		return 0; // failed
	}

	return 1; // passed
}

⌨️ 快捷键说明

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