Skip to content

Add generic and/or with flexibel inputs & allow unconnected pins - #4746

Open
dirkx wants to merge 1 commit into
LinuxCNC:masterfrom
dirkx:feat-multi-input-and-or
Open

dirkx wants to merge 1 commit into
LinuxCNC:masterfrom
dirkx:feat-multi-input-and-or

Conversation

@dirkx

@dirkx dirkx commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Replaces/fixes PR #4720.

@dirkx dirkx mentioned this pull request Oct 29, 2026
and2(9)
and
or2(9).
or(9), and2(9) and or2(9).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be or_n(9) now, after the rename? Same for and(9) in or_n.comp see_also.

Suggested change
or(9), and2(9) and or2(9).
or_n(9), and2(9) and or2(9).

maximum number of inputs is 128 (hardcoded). If there are no input pins at all (personality=0); then
the output is *FALSE*.
Set the number of pins via personality. The default value is a single *OR* with 8
inputs; so personality=8. The maximum number of inputs is 155(hardcoded). If there

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 155 should be 255, or am I missing something?

Suggested change
inputs; so personality=8. The maximum number of inputs is 155(hardcoded). If there
inputs; so personality=8. The maximum number of inputs is 255 (hardcoded). If there


license "ASLv2";
license "GPL";
author "Dirk-Willem van Gulik <dirkx(at)webweaving(punto)org";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the closing >? Same in or_n.comp.

Suggested change
author "Dirk-Willem van Gulik <dirkx(at)webweaving(punto)org";
author "Dirk-Willem van Gulik <dirkx(at)webweaving(punto)org>";

@@ -1,15 +1,15 @@
component or "Arbitrary input OR gate";
pin in bool in##[128:personality] = 0 "in";
component or_n "compute the logical OR of up to 255 inputs.";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small things: "Compute" capitalised like and_n, and maybe a doc string on function _ as in and_n? git diff --check also shows some trailing whitespace in both files.

@BsAtHome

Copy link
Copy Markdown
Contributor

You may need to rebase to master. The original merge was reverted. It seems that this PR is trying to diff something that is not present in current master. Not sure why this isn't flagged.

@grandixximo

grandixximo commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

I think that is just how it looks after a revert, the files may not be present in the current head of master, but they are present in the history.

@grandixximo

grandixximo commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

@dirkx I tested the merge locally and although it does look like it does for the reason I said, that does not change the fact that as @BsAtHome suggested this needs a rebase on master to land properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants