📄 systemevent.c
字号:
#include <at89x52.H> // SFR definition header file
#include <stdio.h> // prototype declarations for I/O functions
#include "function.h"
#include "SystemEvent.h"
#include "math.h"
#include "UART.h"
#include "ExtVar.h"
#include "RTOS.h"
#include "IRKey.h"
static idata unsigned int _Mask=0x0001;
extern unsigned char DecodeIRCommand(unsigned long _RC_WordX);
extern unsigned char RCFuncX(unsigned char _RC_DataX);
extern void InitRemoteCTRL(void);
void SystemEvent(void){
unsigned int _StatuX;
do{
_StatuX=_FuncX;
if(_FuncX!=_Normal){
do{
if(_Mask==0x0100) _Mask=0x0001;
else _Mask<<=1;
_StatuX=(_FuncX&_Mask);
}while(_StatuX==0);
}
switch(_StatuX){
case _ReadI2CMode:
ReadFunc();
StartTriI2C();
_Busy=0;
_FuncX&=~_ReadI2CMode;
break;
case _WriteI2CMode:
WriteFunc();
EchoToHost();
_FuncX&=~_WriteI2CMode;
break;
case _IRInit:
_FuncX&=~_IRInit;
break;
case _UARTInit:
InitSERIALPort();
_FuncX&=~_UARTInit;
break;
case _IRCommand:
_FuncX&=~_IRCommand;
break;
case _CommandX:
_SubCommand=*_WPtrI2c;
_FuncX&=~_CommandX;
break;
case _Normal:
break;
}
}while(_FuncX!=_Normal);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -