PM_K-1 hardware: fix indicator.py scoping bug (p15 rebind in threshold())

The committed indicator.py errored (UnboundLocalError: p15) -- an augmented assign on a
global Net inside threshold() made it local. Flipped to rt[1]+=p15. Now ERC 0 / netlist 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Me Here 2026-05-30 23:49:50 -05:00
parent 367951c903
commit 25d0c57d79

View file

@ -47,7 +47,7 @@ def peak_detect(src):
def threshold(div_top, div_bot):
n = Net(); rt = R(value=div_top); rb = R(value=div_bot)
p15 += rt[1]; rt[2] += n; rb[1] += n; rb[2] += gnd
rt[1] += p15; rt[2] += n; rb[1] += n; rb[2] += gnd # rt[1]+=p15 (not p15+=...) to avoid local rebind
return n
# signal-present: low threshold ; clip: high threshold (TUNABLE)