📄 sys_main.c
字号:
#include "sys_def.h"
#include "sys_rsc.h"
#include "drv_cld.h"
#include "drv_lcd.h"
#include "drv_kbd.h"
#include "mng_tsk.h"
#include "mng_irq.h"
#include "mng_tmr.h"
#include "lib_lcd.h"
/*******************************************************************************
// 变量定义
*******************************************************************************/
/*******************************************************************************
// 函数定义
*******************************************************************************/
void InitSystem()
{
// 初始化系统模块
TmrMngInit(); //初始化Timer模块
IrqMngInit(); //初始化IRQ模块
MngTskInit(); //初始化Task模块
// 初始化驱动模块
LcdInit(); //初始化LCD模块
CldInit(); //初始化Calendar模块
KbdInit(); //初始化Keyboard模块
/* 显示开机画面 */
for (int i = 0; i < 7; ++i){
DrawBMP(i, 0, 0, 0);
RefreshScreen();
Delay(500);
}
ClearScreen();
RefreshScreen();
return;
}
void ClearSystem()
{
/* 显示关机画面 */
for (int i = 8; i < 17; ++i){
DrawBMP(i, 0, 0, 0x80);
RefreshScreen();
Delay(500);
}
ClearScreen();
RefreshScreen();
return;
}
/*******************************************************************************
// System main loop
*******************************************************************************/
void main()
{
InitSystem();
while (TRUE){
DrawInt(GetTickCount(), 0, 0, 0x80);
DstrbtMsg();
RefreshScreen();
__bis_SR_register(LPM0_bits + GIE);
}
ClearSystem();
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -