📄 main.c
字号:
/*********************************************************************************************
* File: main.c
* Author: embest
* Desc: c main entry
* History:
* Create: Rijing Date: 2003.08.25
* Modify: (1) Rijing upDate: 2003.08.25
* () upDate:
* Desc:
*********************************************************************************************/
#include <stdio.h>
#include "44blib.h"
#include "44b.h"
#include "rtc.h"
#include "lcd.h"
#include "44blib.h"
#include "keyboard.h"
extern void init_keyboard();
extern inline int key_read();
extern int g_nYear,g_nMonth,g_nDay,g_nWeekday,g_nHour,g_nMin,g_nSec;
extern char *g_szDate[8];
//extern void DelayMs(int ms_time);
char sDATE[30];
char sTIME[10];
void Main(void)
{
sys_init(); /* Initial 44B0X's Interrupt,Port and UART */
_Link(); /* Print Misc info */
rINTMOD=0x0;
rINTCON=0x01;
rINTMSK=~(BIT_GLOBAL | BIT_EINT4567); //use Extern 6 to set time
//use Extern 7 to set Alarm time
rPCONG=0xffff; // EINT7~0
rPUPG=0x0; // pull up enable
//Uart_Init(0,115200);
Lcd_Init();
Lcd_Clr();
Lcd_DspAscII8x16(10, 20, BLACK, "Real Time Conter Module Display");
Lcd_DspAscII8x16(10, 50, BLACK, "2004434 20042193 ");
Lcd_DspHz16(145, 50, BLACK, "姜峰");
DelayMs(1000);
Lcd_DspAscII8x16( 10, 20, WHITE, "Real Time Conter Module Display");
Lcd_DspAscII8x16( 10, 50, WHITE, "2004434 20042193 ");
Lcd_DspHz16(145, 50, WHITE, "姜峰");
//Lcd_DspAscII8x16( 10, 20, BLACK, "Please Press Key 6 to set time");
rtc_init(); //init rtc module
rtc_tick_test();
init_keyboard();
while(1)
{
rtc_read();
sprintf(sDATE,"%4x-%2x-%2x",g_nYear,g_nMonth,g_nDay);
sprintf(sTIME,"%s %02x:%02x:%02x\r",g_szDate[g_nWeekday],g_nHour,g_nMin,g_nSec);
Lcd_DspAscII8x16(10,20,BLUE,sDATE);
Lcd_DspAscII8x16(10,50,BLUE,sTIME);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -