processor_version_test.c

来自「ADI Blackfin BF51X 範例程式」· C语言 代码 · 共 36 行

C
36
字号
/*******************************************************************
Analog Devices, Inc. All Rights Reserved.

This software is proprietary and confidential.  By using this software
you agree to the terms of the associated Analog Devices License Agreement.

Project Name:  	Power_On_Self_Test

Hardware:		ADSP-BF518F EZ-Board

Description:	This examples performs a processor version check on the EZ-Board.
*******************************************************************/
#include <cdef_LPBlackfin.h>
#include <ccblkfn.h>


/*******************************************************************
*   Function:    TEST_VERSION
*   Description: This function compares the version of the processor
* 				 being run on with the version that the software was
*				 built against.  This will catch a different version
*				 of silicon than what it was built for.
*******************************************************************/
int TEST_VERSION(void)
{
	int j = *pDSPID;				/* check the part */
	int k = __SILICON_REVISION__;	/* check what we built against */

	if( __SILICON_REVISION__ != ((*pDSPID) & 0xFF) )
	{
		return 0; /* if different, fail */
	}

	return 1; /* if same, pass */
}

⌨️ 快捷键说明

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