📄 main.c
字号:
#include "SPCE061A.h"
/*#define P_IOB_Data (volatile unsigned int *)0x7003
#define P_IOB_Dir (volatile unsigned int *)0x7007
#define P_IOB_Attrib (volatile unsigned int *)0x7008
#define P_IOA_Data (volatile unsigned int *)0x7000
#define P_IOA_Dir (volatile unsigned int *)0x7002
#define P_IOA_Attrib (volatile unsigned int *)0x7003
#define P_Watchdog (volatile unsigned int *)0x7012
#define P_INT_Ctrl (volatile unsigned int *)0x7010
#define P_INT_Clear (volatile unsigned int *)0x7011
#define P_TimeA_Ctrl (volatile unsigned int *)0x700B
#define P_TimeA_Data (volatile unsigned int *)0x700A*/
const unsigned int g_Data[] = {0x003f,0x0006,0x005b,0x004f, 0x0066,0x006d,0x007d,0x0007,0x007f,0x006f};
unsigned int n=0,a,i=0,t,x,g;
long f;
unsigned int x0,x1,x2,x3,x4,x5,m,bb;
void Delay(unsigned int y);
void led(unsigned int x);
void chushihua();
//void __attribute__((ISR))IRQ1(void);
void __attribute__((ISR))IRQ4(void);
void __attribute__((ISR))IRQ5(void);
//void __attribute__((ISR))FIQ(void);
////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
Delay(100);
__asm("INT OFF");
chushihua();
__asm("INT IRQ");
while(1)
{
x5=f/100000; //最高位
Delay(10);
x4=(f%100000)/10000;
Delay(10);
x3=(f%10000)/1000;
Delay(10);
x2=(f%1000)/100;
Delay(10);
x1=(f%100)/10;
Delay(10);
x0=f%10;
Delay(10);
*P_Watchdog_Clear=0x0001 ;
}
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
void Delay(unsigned int y)
{
unsigned int j;
for(j=0;j<=y;j++) ;
*P_Watchdog_Clear=0x0001;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -