AnsweredAssumed Answered

If Statement and Operands on STM8L

Question asked by pietroforte.angelo on Dec 30, 2014
Latest reply on Jan 7, 2015 by Ian Legg
Would someone assist with the logic of my 4 stage if-statement.  It basically performs one of four groups depending upon how 2 dip switches are set.  The problem is that no matter how I set the 2 dip switches it always goes to line 868 (see attachment).  I can never get it to go to line 859, 862, or 865, no matter how I set the external dip switches.  I have monitored the dip switches and they are functioning properly as a 3.3V or 0V logic level, depending upon dip position.  Dip 1 interfaces to PA2, and dip 2 interfaces to PC5.

Maybe I don't have my parenthesis set correct, or maybe my center & needs to be &&?  Perhaps my ! is not the correct operand?  I even tried a different approach as per line 839-855, but that didn't work AT ALL, i.e., after setting breakpoints at 841,845,850,or 854, it never stopped.