📄 tick.c
字号:
#include "..\inc\44b.h"
#include "..\inc\44blib.h"
void __irq Rtc_Tick(void);
int sec_tick=1;
void Main(void)
{
//测试是 因为一下几句的原因导致程序经常不能
/* rSYSCFG=SYSCFG_8KB;
#if (PLLON==1)
ChangePllValue(PLL_M,PLL_P,PLL_S);
#endif
*/
Uart_Select(0);
Port_Init();
Uart_Init(0,115200);
Uart_Printf("Qqqqqqqqqqqqq");
rINTMSK=0x7ffffff;
Uart_Printf("1\n");
Uart_Printf("Typing any key to exit!!!\n");
pISR_TICK=(unsigned)Rtc_Tick;
rINTCON=0x5; //Non-vectored,IRQ enable,FIQ disable //
rINTMOD=0x0;
Uart_Printf("!!!\n");
rINTMSK=~(BIT_GLOBAL|BIT_TICK);
Uart_Printf("!\n");
rRTCCON=0x0; //R/W disable(for power consumption), 1/32768, Normal(merge), No reset
rTICINT = 1+(1<<7); //START
while(1);
}
/*void Main(void)
{ Uart_Select(0);
Port_Init();
Uart_Init(0,115200);
Uart_Printf("[RTC Tick interrupt test for S3C44B0X]\n");
Uart_Printf("Please check the VDDRTC connector or connect the VDD to Bt1+ !!!\n");
Uart_Printf("Typing any key to exit!!!\n");
pISR_TICK=(unsigned)Rtc_Tick;
sec_tick=1;
rINTMSK=~(BIT_GLOBAL|BIT_TICK); Uart_Printf("Typing any key to exit!!!\n");
rRTCCON=0x0;
//R/W disable(for power consumption), 1/32768, Normal(merge), No reset
rTICINT = 127+(1<<7); //START
Uart_Getch();
}
*/
void __irq Rtc_Tick(void)
{
rI_ISPC=BIT_TICK;
Uart_Printf("%03d sec",sec_tick++);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -