?? leddemo.c
字號(hào):
#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 測(cè)試信號(hào)----- \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;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -