Today I was changing my encoder routines over to use Brian Low's Rotary library. A snippet from the routine was:
switch (result) {
case DIR_CW: // Turned it clockwise, 16
tuneChange = 1L;
break;
case DIR_CCW: // Turned it counter-clockwise\
tuneChange = -1L;
break;
}
newFreq = (long)freqIncrement * tuneChange;
No matter what I did the encoder would not decrease the tuned frequency. As everyone but me sees immediately, the DIR_CCW case comment has the macro-continuation character at the end of the comment, which makes the compiler pretty much ignore the tuneChange in that case. The formatting here makes it obvious. The IDE does not. I don't know how I managed to hit that key while typing the comment, but I did. Just a word to wise.