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

📄 testapp1.c

📁 基于DSP2000的例程
💻 C
字号:
/*
 *  Copyright (c) 2001-2002, Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
*/

/*
 * Description: Driver program that makes use of two library functions to
 * calculate the maximum, minimum and spread values within an array
*/


#include <stdio.h>

#if defined(_TMS320C2XX)
#define WDCR        *((volatile int *)0x7029)    /* WD Control reg */
#define DISABLE_WD  0x0068
/*******************************************************
	Disable_WD()
	============
	
	This function disables the f24xx watch dog timer;
	
*******************************************************/
void Disable_WD(void)
{
    WDCR |= DISABLE_WD;
}
#endif

int main()
{
	int test_data[] = { 7, 13, 3, 25, 64, 15 };

	int max_value = maximumValue(test_data, 5);
	int min_value = minimumValue(test_data, 5);

#if defined(_TMS320C2XX)
    Disable_WD();
#endif

	// call library functions
	printf( "The maximum value in the data is %d\n", max_value );
	printf( "The minimum value in the data is %d\n", min_value );	
	printf( "The spread of the data is %d\n", max_value - min_value ); 

	return 0;
}

⌨️ 快捷键说明

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