#include<rtx51tny.h>
#include<AT89X52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
#define L8 0x7f
#define L7 0xbf
#define L6 0xdf
#define L5 0xef
#define L4 0xf7
#define L3 0xfb
#define L2 0xfd
#define L1 0xfe
uchar select_data;
sbit key1=P3^4;
sbit key2=P3^3;
sbit key3=P3^7;
void init(void)_task_ 0
{
os_create_task(1);
os_delete_task(0);
}
void select(void)_task_ 1
{
while(1)
{
if((key1==0)&(key2==1)&(key3==1))
{
select_data=select_data+1;
select_data=select_data+1;
select_data=select_data+1;
} else
{
select_data=select_data-1;
}
}
}
程序执行时,select_data变量的值一直为0,不肯变化,有哪位大神知道原因吗?求指点! |