From edd13b30fcd3bcfe0f7aa552ee9f26c61947cd34 Mon Sep 17 00:00:00 2001 From: linuxcnc Date: Thu, 29 Oct 2026 19:19:48 +0000 Subject: [PATCH] Update/correct, credits/thanks to @BsAtHome --- src/hal/components/{and.comp => and_n.comp} | 16 +++++++--------- src/hal/components/{or.comp => or_n.comp} | 13 ++++++------- 2 files changed, 13 insertions(+), 16 deletions(-) rename src/hal/components/{and.comp => and_n.comp} (65%) rename src/hal/components/{or.comp => or_n.comp} (67%) diff --git a/src/hal/components/and.comp b/src/hal/components/and_n.comp similarity index 65% rename from src/hal/components/and.comp rename to src/hal/components/and_n.comp index e39571171e0..3d77862ea25 100644 --- a/src/hal/components/and.comp +++ b/src/hal/components/and_n.comp @@ -1,5 +1,5 @@ -component and "Multi input AND gate"; -pin in bool in##[128:personality] = 1 "input pins, up to personality-1"; +component and_n "Compute the logical AND of up to 255 inputs."; +pin in bool in##[255:personality] = 1 "inputs (default is TRUE)"; pin out bool out "output pin; the AND of all inputs"; description """ @@ -7,24 +7,22 @@ The *out* pin is set to *TRUE* if all the inputs are all *TRUE*; or *FALSE* if o The value for a unconnected pin is TRUE; so it is fine to leave a pin unconnected. -Set the number of pins via personality. The default value is a single *AND* with 8 inputs; so personality=8. The maximum number of inputs is 128 (hardcoded). If there are no inputs specified (personality=0); then the output value +Set the number of pins via personality. The default value is a single *AND* with 8 +inputs; so personality=8. The maximum number of inputs is 255 (hardcoded). +If there are no inputs specified (personality=0); then the output value is TRUE. """; function _ "Logical AND"; see_also """ -*or*(9), -and2(9) -and -or2(9). +or(9), and2(9) and or2(9). """; option period no; option default_personality 8; -option default_count 1; -license "ASLv2"; +license "GPL"; author "Dirk-Willem van Gulik