怎么在淘宝上买游戏脚本

 我来答
亚平宁的清风
2015-03-23
知道答主
回答量:6
采纳率:0%
帮助的人:2.8万
展开全部
#include "stdio.h"

#define U8 unsigned char
#define U16 unsigned int
#define INT int
#define CHAR char
#define ON 1
#define OFF 0
#define INFRARED_SWITCH P2
#define NOBODY 0X00
#define TIME1 1
#define TIME0 0
#define TOTAL_I EA
#define I_T0 ET0
#define I_T1 ET1
#define SUCCESS 0
#define FALURE -1
#define DEBOUNCE_TIME
#define DEBOUNCE_NUM
#define DEBOUNCE_SET TIME0
#define OVERTIME_TIME
#define OVERTIME_NUM
#define OVERTIME_SET TIME1

CHAR t0_Num, t1_Num;
U8 *t0_Data;
U8 *t1_Data;
U8 t0_H, t0_L, t1_H, t1_L;
U8 frist_Trigger, secred_Trigger;
U8 studet_Num;

U16 cp_Line;

INT Time_open(U16 time, CHAR num, U8 set, U8 *data)
{
if(TIME0 == set){
t0_Num = num;
t0_H = (U8)(time >> 8);
t0_L = (U8)(time & 0x00ff);
TH0 = t0_H;
TL0 = t0_L;
I_T0 = ON;
t0_Data = data;
return SUCCESS;
}
if(TIME1 == set){
t1_Num = num;
t1_H = (U8)(time >> 8);
t1_L = (U8)(time & 0x00ff);
TH1 = t1_H;
TL1 = t1_L;
I_T1 = ON;
t1_Data = data;
return SUCCESS;
}

return FALURE;
}

INT Debounce(U8 sw_data)
{
U8 debounce_flag = 0;

if(SUCCESS != Time_open(DEBOUNCE_TIME, DEBOUNCE_NUM, DEBOUNCE_SET, &debounce_flag)){
cp_Line = __LINE__;
return FALURE;
}
for(;;){
if(1 == debounce_flag){
if(sw_data == INFRARED_SWITCH){
while(INFRARED_SWITCH);
return SUCCESS;
}
return FALURE;
}
}
}

INT State_switch(U8 *state)
{
U8 data;

if(NOBODY == INFRARED_SWITCH){
*state = 0;
return NOBODY;
}

data = INFRARED_SWITCH;
if(SUCCESS == Debounce(data)){
*state = data;
return SUCCESS;
}
return NOBODY;
}

INT main (U16 argc, U8 **argv)
{

}

void T0_SR(void) interrupt 1
{
t0_Num--;
if(0 > t0_Num){
*t0_Data = 1;
I_T0 = OFF;
}
TH0 = t0_H;
TL0 = t0_L;
}

void T1_SR(void) interrupt 3
{
t1_Num--;
if(0 > t1_Num){
*t1_Data = 1;
I_T1 = OFF;
}
TH1 = t1_H;
TL1 = t1_L;
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式