simplified AbstractBusHandler.java

This commit is contained in:
hneemann 2018-03-05 14:22:06 +01:00
parent 0f767fee52
commit edb26aa362

View File

@ -83,28 +83,24 @@ public abstract class AbstractBusHandler {
highz &= input.getHighZ(); highz &= input.getHighZ();
value |= input.getValue(); value |= input.getValue();
} }
value &= ~highz;
// check for a burn! // check for a burn condition!
for (ObservableValue input : getInputs()) { for (ObservableValue input : getInputs()) {
long bothDefine = ~(highz | input.getHighZ()); long bothDefine = ~(highz | input.getHighZ());
if ((value & bothDefine) != (input.getValue() & bothDefine)) if ((value & bothDefine) != (input.getValue() & bothDefine))
burn = State.burn; burn = State.burn;
} }
if (highz != 0) { switch (getResistor()) {
switch (getResistor()) { case pullUp:
case pullUp: set(value | highz, 0);
set(value | highz, 0); break;
break; case pullDown:
case pullDown: set(value, 0);
set(value, 0); break;
break; default:
default: set(value, highz);
set(value, highz); }
}
} else
set(value, 0);
} }
// if burn condition and not yet added for post step check add for post step check // if burn condition and not yet added for post step check add for post step check