为什么 codevision avr 忽略"if"运算符中的某些语句?

Why codevision avr ignores some statements in "if" operator?

本文关键字:语句 运算符 codevision avr 忽略 if 为什么      更新时间:2023-10-16

现在它可以正常工作了。当然这是我的错误,但没有你的问题很难解决。

   if ((key==11)^(key==13)^(key==16)^(key==17))   //this is the only 
                              // dirty hack style string needed to fix this
        {  
            switch (key)
                { 
                     case 11: { mode=0x01; break; }  //plus
                     case 13: { mode=0x02; break; }  //minus 
                     case 16: { mode=0x03; break; } //multiply
                     case 17: { mode=0x04; break; } //divide
                }  
            if (mode)
                {  
                      buffer=atof(display);  
                      firstop=1;  
                      first=1;   
                      redraw=1; 
                                      //and to delete the goto
                }   
        }

您永远不会重置模式,因此按下一次将继续为任何其他键执行所选模式。

您在切换语句中没有定义默认语句

尝试使用编译器优化开关。如果它解决了您的问题,那么它可能是volatile问题,其中模式被优化出