Fixes an error in the presettable counter; closes #374

This commit is contained in:
hneemann 2019-11-06 17:52:39 +01:00
parent 832de23263
commit 1107b1e778

View File

@ -64,9 +64,10 @@ public class CounterPreset extends Node implements Element {
this.out = new ObservableValue("out", bits).setPinDescription(DESCRIPTION);
this.ovf = new ObservableValue("ovf", 1).setPinDescription(DESCRIPTION);
long m = attributes.get(Keys.MAX_VALUE);
long mask = Bits.mask(bits);
long m = attributes.get(Keys.MAX_VALUE) & mask;
if (m == 0)
m = Bits.mask(bits);
m = mask;
maxValue = m;
probe = attributes.get(Keys.VALUE_IS_PROBE);