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

📄 leddemo.c

📁 ARM9-2410的LED灯点亮码源
💻 C
字号:
#include "2410library.h"
#include "interrupt.h"
#include <stdlib.h>
#include "def.h"

U8 test[6] = {0,1,2,3,4,5};  //Seg7
int NumInt = 0;

void  __irq Irq_Handle(void);

void  __irq Irq_Handle(void)
{	
	NumInt = NumInt + 1;
	Seg7_Display(0x3f,test);
	Uart_SendString("this is interrupt handler! \n");
	Uart_Printf("the times of interrupt is %d \n",NumInt);
	Irq_Clear(IRQ_EINT3);
}

int Main()
{    
	
	ChangeClockDivider(1,1);
	ChangeMPllValue(0xa1,0x3,0x1);
	
	//serial related operation
	Uart_Init(0,115200);
	Uart_Select(0);	
	
	Uart_Printf("\n ----UART 测试信号----- \n");
	
	//interrupt related operation	
	Isr_Init();
	Port_Init();
	Irq_Request(IRQ_EINT3,(void *)Irq_Handle);
	Irq_Enable(IRQ_EINT3);
	
	//check circuit operation	
	Led_Display(0x0);
	Delay(100);
	Led_Display(0xf);
	Delay(100);
	Seg7_Display(0x3f,test);	
	

	while(1)
	{
	
		Seg7_Display(0x0f,test);
					 
	}	 
	return 0;
}


⌨️ 快捷键说明

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