switch (state & 0x0f) {
    case FWD_STOP_S1:
    case FWD_STOP_S2:
    case FWD_STOP_S3:
    case FWD_STOP_S4:
    case BKW_STOP_S1:
    case BKW_STOP_S2:
    case BKW_STOP_S3:
    case BKW_STOP_S4:
        // Nothing to do - just waiting for a running state.
        break;
    case FWD_S1:
    .
    .
}