?? maintime.c.bak
字號:
//#define DEBUG_MSG
#include "target.h"
#include "key.h"
unsigned int idata count_timer = 0xffff;
unsigned int idata old_count_timer = 0xffff;
unsigned int idata TimeMessage = 0;
unsigned int idata TVCount = 1;
//bit flagp12 =0;
bit btpowerswitch=1; //default high
bit btPowerKeyPressed=0;
bit btaccswitch = 1;
unsigned char idata count_key=20;
extern bit bPowerStatus;
extern unsigned char idata IrDoubleKeyTimer;
extern unsigned char idata IrDoubleKey;
#ifdef __KEY__
unsigned char TimerReadKey20ms();
unsigned char scankeycount = 0;
#endif
//1ms
void Timer1_Int() interrupt 3 using 2
{
TR1=0;
TH1=TIMERH;
TL1=TIMERL;
TR1=1;
// if(flagp12) p12_high();
// else p12_low();
// flagp12 = ~flagp12;
if(count_key!=0xff && count_key>0){
count_key--;
}
#ifdef __KEY__
if(scankeycount<10)
scankeycount++;
else
scankeycount = 0;
#endif
if((count_timer!=0xffff)&&(count_timer>0))
count_timer--;
if((IrDoubleKeyTimer != 0xff) && (IrDoubleKeyTimer>0))
IrDoubleKeyTimer--;
if(TVCount<500)
TVCount++;
else
TVCount = 0;
}
void SetTimerFunc(unsigned int count,unsigned int message)
{
count_timer = count;
old_count_timer = count_timer;
TimeMessage = message;
}
/*
void ResetCount()
{
if(count_timer!=0xff&&count_timer)
count_timer = old_count_timer;
}
*/
extern void NotDoubleKey();
extern unsigned char ucSystemMode;//adny
void MainTimeHandle()
{
unsigned char uctemp;
#ifdef __TUNER__
TunerTimeHandle();
#endif
if(count_key==0){
count_key=20;
if(!Read_PowerSwitch()){
if(btpowerswitch){
btpowerswitch=0;
}
}
else{
if(!btpowerswitch){
btpowerswitch=1;
SaveKeyToBuff(POWER_KEY);
if( bPowerStatus ){
btPowerKeyPressed = 1;
if(count_timer==0xffff)
SetTimerFunc(TIME_1SEC*5,POWERTIMEOUT_KEY);
//ShowLcdString(0x00,"power on ");
}
}
}
if(Read_AccSwitch()){
if(!btaccswitch){
btaccswitch=1;
}
}
else{
if(btaccswitch){
btaccswitch=0;
}
}
}
#ifdef __KEY__
if(scankeycount==0)
TimerReadKey20ms();
#endif
if(count_timer==0){
count_timer = 0xffff;
if(TimeMessage)
SaveKeyToBuff(TimeMessage);
}
if(TimeMessage==PS_TIMEOUT){
uctemp = count_timer % TIME_1SEC;
if( uctemp ==0){
uctemp = count_timer / TIME_1SEC;
uctemp &= 0x1;
if(uctemp){
SaveKeyToBuff(REDRAW_KEY);
}
else{
SaveKeyToBuff(CLEARSCREEN_KEY);
}
}
}
if(IrDoubleKeyTimer ==0){
NotDoubleKey();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -