Hi - this is a compiler/coding question.
Usually if there's no break at the end of the case, the program should "fall through" to the next case.
I ignored the warning (which is good - in case I may have overlooked the fact that there's no break) but I see that the compiler adds in its own break and doesn't allow the "fall through". Is there any way to have it fall-though? This will save unnecessary repeating of code. (Code snippet below.)
Thanks,
Mechi
switch(status)
{
case BUTTON_IDLE:
if ((sTime.systemTicks - sButton.up_time) < BUTTON_IDLE_TIME)
break;
// else fall thru
case BUTTON_WAIT_FOR_PRESS:
sButton.up_time = sTime.systemTicks;
sButton.up_status = BUTTON_PRESSED;
break;
}