sbit JUMP_01 = P0^0; //;第01位拨码开关 第01-03位:
任意一位打上为绿灯信号,打下则为红灯信号
sbit JUMP_02 = P0^1; //;第02位拨码开关
sbit JUMP_03 = P0^2; //;第03位拨码开关
uchar code SG_01; //;第01位拨码状态 第01-03位:
任意一位打上为绿灯信号,打下则为红灯信号
uchar code SG_02; //;第02位拨码状态
uchar code SG_03; //;第03位拨码状态
void GETJUMP()
{
P0 = 0xff;
_nop_();
_nop_();
if(JUMP_01==1) {SG_01 = 0;} else {SG_01 = 1;}
if(JUMP_02==1) {SG_02 = 0;} else {SG_02 = 1;}
if(JUMP_03==1) {SG_03 = 0;} else {SG_03 = 1;}
if(JUMP_04==1) {SG_04 = 0;} else {SG_04 = 1;}
if(JUMP_05==1) {SG_05 = 0;} else {SG_05 = 1;}
if(JUMP_06==1) {SG_06 = 0;} else {SG_06 = 1;}
if(JUMP_07==1) {SG_07 = 0;} else {SG_07 = 1;}
if(JUMP_08==1) {SG_08 = 0;} else {SG_08 = 1;}
}
出现错误提示:unmodifiable lvalue
那里错了呢?新手,请高手指教 |