#pragma XOD dirtieness disable
node {
bool prevA = true;
bool prevB = true;
void evaluate(Context ctx) {
bool nextA = ::digitalRead(constant_input_Pa);
bool nextB = ::digitalRead(constant_input_Pb);
if ((nextA && nextB) || (prevA && prevB && nextA != nextB)) {
prevA = nextA;
prevB = nextB;
} else if (nextA == prevB && nextB == prevA) {
if (nextA) {
emitValue<output_FWD>(ctx, true);
} else {
emitValue<output_BWD>(ctx, true);
}
}
}
}