📄 time.c
字号:
#ifndef _TIME_C_
#define _TIME_C_
#include "serial.h"
#include "api.h"
#define RC7017_SEND_TIME 20
#define SYSTEM_LIGHT 100
#define SYSTEM_TIME_COUNTER 200
#define KEY_VOICE_TIME 5
void Time0_Interrupt(void) interrupt TIME0_INTERRUPT_VECTOR
{
TH0 = 0xb8; //初始化定时器0
TL0 = 0x00; //22.1184MHz时钟下定时时间为10ms
gSystemInfo.system_time_counter = (gSystemInfo.system_time_counter + 1)%SYSTEM_TIME_COUNTER;
if( gSystemInfo.reboot_flag == SYSTEM_NORMAL )
{
if( !(gSystemInfo.system_time_counter%gSystemInfo.run_time) )
run_flag = enable;
}
if( !(gSystemInfo.system_time_counter%RC7017_SEND_TIME) )
gSystemInfo.rc7017sendflag = SENDING;
if( !(gSystemInfo.system_time_counter%SYSTEM_LIGHT) )
gSystemInfo.light_process_flag = TASK_EXECUTE;
if( gIoSerial.ReveiveOverTime < RECEIVE_TIME_OVER )
{
gIoSerial.ReveiveOverTime ++;
if( gIoSerial.ReveiveOverTime >= RECEIVE_TIME_OUT )
{
emulateStopReceive();
gIoSerial.ReceiceLength = gIoSerial.Iocounter;
gIoSerial.Iocounter = 0;
gIoSerial.ReveiveStatus = RECEIVE_OVER;
gIoSerial.ReveiveOverTime = RECEIVE_TIME_OVER;
}
}
#if _LCD_MENU_
if( !(gSystemInfo.system_time_counter%KEY_VOICE_TIME) )
{
menu_key_scan();
}
if( !(gSystemInfo.system_time_counter%MENU_STATUS_PROCESS) )
menu_process_flag = enable;
if( !gSystemInfo.system_time_counter )
menu_init_flag = enable;
#endif
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -