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

📄 processorversion_test.c

📁 ADSP 地层驱动
💻 C
字号:
/*****************************************************************************
**																			**
**	 Name: 	ProcessorVersion.c											    **	
**																			**
******************************************************************************

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

Pjoject Name:	BF533 POST

Date Modified:	18October05	Ver 0.0

Software:		VisualDSP++ 4.0

Hardware:		ADSP-BF533 EZ-KIT Lite

Connections:	

Purpose:		To test the processor version agaisnt the software build

*****************************************************************************/
#include <cdef_LPBlackfin.h>
#include <ccblkfn.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)
{
#if (__SILICON_REVISION__ == 0x0004) 	// if building for rev 0.4
	// anomaly 05000234 - Incorrect Revision Number in DSPID Register
	if( 3 == ((*pDSPID) & 0xFF) )
	{
		volatile int *pREVID = (volatile int *)0xFFC00014;
		
		int t = (((*pREVID) >> 28) & 0xFF);
		
		if(__SILICON_REVISION__ == t )
		{
			return 1; // 
		}
	}
	
	return 0;
#else
	if( __SILICON_REVISION__ != ((*pDSPID) & 0xFF) )
	{
		return 0; // failed
	}

	return 1; // passed
#endif
}

⌨️ 快捷键说明

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