maina.c

来自「基于TS201 Sets up a skeleton overlay syste」· C语言 代码 · 共 45 行

C
45
字号
//***********************************************************************
//      Main routine for the TigerSHARC EZ-Kit DSPA (ID 0)
//      Overlay example in C
//      Maina.c
//***********************************************************************

#ifdef __ADSPTS201__
#include "cache_macros.h"
asm("#include <cache_macros.h>");
asm("#include <defts201.h>");
#endif


//************************* Externs *************************************
extern	void inita(void);                                   
extern	void funct1(void);                                   
extern	void funct2(void);                                   
extern	void funct3(void);                                   
extern	void funct4(void);  
                                

//************************** Main Code *********************************
void main(void)
{
#ifdef __ADSPTS201__
	/* in the case of TS201, at the beginning of the program the
	   cache must be enabled. The procedure is contained in the
	   cache_enable macro that uses the refresh rate as input parameter
       -if CCLK=500MHz, refresh_rate=750
       -if CCLK=400MHz, refresh_rate=600
       -if CCLK=300MHz, refresh_rate=450
       -if CCLK=250MHz, refresh_rate=375 */
	asm("cache_enable(750);");					// Enable cache for ADSP-TS201 EZ-KIT
#endif
	inita();									// Initialize system
	funct1();                                   // call function 1
	funct2();                                   // call function 1
	funct3();                                   // call function 1
	funct4();                                   // call function 1
	while(1){}                                  // And wait in infinite loop
}
//***********************************************************************


⌨️ 快捷键说明

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