Repository navigation
Conversation
…inuxCNC#3519) In bargraph mode the selection was clamped to personality-1 as in one-hot mode, so the top output never came on. Bargraph has personality+1 states (none .. all on); one-hot still clamps to the last output. sel-uint is a 64-bit pin but was summed into an int, so large values truncated (0xFFFFFFFF read as -1: every output off). It is now clamped to personality before the bit inputs are added, so no selection can wrap. tests/demux-bargraph checks every output for selections 0..5 in both modes, a bit input, the largest 32- and 64-bit sel-uint values, and a 1-output demux. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pins and params of an array sized by an expression were documented as 00..personality; the last index is personality-1. Expressions that are not a plain name are bracketed: 00..(personality & 0xff)-1. Affects the man pages of bitmerge, bitslice, carousel, demux, gantry, limit_axis, lincurve, logic, max31855, moveoff, multiswitch, output_buffer and radiobutton. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Why is this touching halcompile with such complexity? If you say it should read There is an additional problem in the bargraph mode. Using the bit inputs, you cannot select all on with personality at 32 because the bargraph has 33 states but only 5 bits as input. Additionally using the But looking at the changes,... The change in demux should also be more structured. The change is rather complicated IMO and the luster casting is unnecessary when the proper types are used (rtapi_u64 is not the right type). In that sense, it would also be better to fix the forced ternary evaluation with Why is this adding a test? Are there any suspicions that an unrelated change somewhere in the codebase breaks this? That would be exceptionally bad because then probably everything breaks or is broken. |
Fixes #3519.
With
bargraphset, a selection ofpersonalityor more should turn every output on. Instead the top output never comes on:Fix (
demux.comp):personality, notpersonality-1. No config can depend on the old behaviour, since the top output could never come on.sel-uintis clamped before it is added to the bit inputs. Before, a value of 2^31 or more went negative and turned every output off, in both modes. That is the only change to one-hot.halcompile (separate commit): man pages showed array pins as
00..personality; the last index ispersonality-1. This fixes 13 components' man pages.Test:
tests/demux-bargraphchecks every output in both modes. It fails without the fix and passes with it.Not in this PR:
demux_generichas a similar cast at 2^63 or more; that needs its own issue.