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

📄 trap_2.c

📁 SH3
💻 C
字号:
/***********************************************************************/
/*                                                                     */
/*  FILE        :trap_2.c                                              */
/*  DATE        :Wed, Oct 25, 2006                                     */
/*  DESCRIPTION :Main Program                                          */
/*  CPU TYPE    :SH7709S                                               */
/*                                                                     */
/*  This file is generated by Renesas Project Generator (Ver.3.1).     */
/*                                                                     */
/***********************************************************************/
                  


#ifdef __cplusplus
//#include <ios>					// Remove the comment when you use ios                  
//int ios_base::Init::init_cnt;		// Remove the comment when you use ios
#endif
#ifdef __cplusplus
extern "C" {
#endif
void abort(void);
#ifdef __cplusplus
}
#endif

#include "7709s.h"
#include "math.h"

#define LED_DATA (*(volatile unsigned short *)0x00800000) /* LED   Address*/

void LED_FLASH(void);

int i,k,Light,j;

/////////////////////////////////////////////////////////////////////////////

void LED_FLASH(void)
{
	LED_DATA=0x55;
	for(j=0;j<3600;j++)
	{
		Light=255;
		Light=sin(j/180.0*3.1416)*255;
		for(i=0;i<0x100000;i++){}
		LED_DATA = Light;
		for(i=0;i<0x100000;i++){}
		LED_DATA = Light;
	}
}

#pragma interrupt(INT_TRAPA)
void INT_TRAPA(void)
{
	LED_FLASH();
}

void main(void)
{
	while(1)
	{
		trasm();
	}
}

void abort(void)
{
	
}

⌨️ 快捷键说明

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