simplified AbstractBusHandler.java

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

View File

@ -83,16 +83,14 @@ 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);
@ -103,8 +101,6 @@ public abstract class AbstractBusHandler {
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