c++ - Why codevision avr ignores some statements in "if" operator? -


now works should. well,certanly mistake,but without of questions itwould difficult rid it.

   if ((key==11)^(key==13)^(key==16)^(key==17))   //this                                // dirty hack style string needed fix         {               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 delete goto                 }            } 

you never reset mode, pressing once keep doing selected mode other key.

you define no default statement in switch statement

try play compiler optimization switches. if solves problem, volatile problem mode gets optimized out


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -