From 2121ea2b7aaee979b84563fdaf850a1c9e32c48d Mon Sep 17 00:00:00 2001 From: is-primary-dev <215415441+is-primary-dev@users.noreply.github.com> Date: Wed, 15 Apr 2026 22:06:23 -0700 Subject: [PATCH] halui: fix inverted HOME_SEQUENCE polarity for halui.home-all creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream commit 2f57090adb ("ini: Implement a new ini-file parser and adapt the code to use it") ported halui.cc's HOME_SEQUENCE check from the old inifile API to the new one and accidentally flipped the polarity of the condition that gates halui.home-all pin creation. Before 2f57090adb (inherited from commit 38d35cdf8e "Add pin home-all to halui pin is created only if HOME_SEQUENCE is properly defined in inifile"): if (inifile.Find("HOME_SEQUENCE", "JOINT_0")) { have_home_all = 1; } Find() returned truthy when the key IS defined, so the pin was created when HOME_SEQUENCE was properly set — matching the commit message's stated intent. After 2f57090adb: if (!inifile.isSet("HOME_SEQUENCE", "JOINT_0")) { have_home_all = 1; } The "!" was added by mistake — isSet() returns true when the key IS set, so the new condition fires only when HOME_SEQUENCE is NOT set, which is the OPPOSITE of the original behavior and the opposite of what 38d35cdf8e's commit message documents. The practical effect: properly-configured machines (which set HOME_SEQUENCE in [JOINT_0]) no longer get the halui.home-all convenience pin after 2f57090adb. halcmd lookups fail with "parameter or pin 'halui.home-all' not found", and any tooling or GUI that pulses halui.home-all to trigger home-all cannot trigger homing at all. Restore the original semantics by removing the "!": if (inifile.isSet("HOME_SEQUENCE", "JOINT_0")) { have_home_all = 1; } Also add a source comment documenting the regression and the original semantics so the next person who looks at this code sees the history without having to dig the git log. --- src/emc/usr_intf/halui.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/emc/usr_intf/halui.cc b/src/emc/usr_intf/halui.cc index c63164dc9f2..6bb32bab61f 100644 --- a/src/emc/usr_intf/halui.cc +++ b/src/emc/usr_intf/halui.cc @@ -1472,7 +1472,15 @@ static int iniLoad(const char *filename) } } - if (!inifile.isSet("HOME_SEQUENCE", "JOINT_0")) { + // Create halui.home-all pin only if [JOINT_0]HOME_SEQUENCE is properly + // defined (original semantics from commit 38d35cdf8e). Commit 2f57090adb + // ("ini: Implement a new ini-file parser...") ported the old + // `inifile.Find("HOME_SEQUENCE", "JOINT_0")` check to the new API as + // `!inifile.isSet("HOME_SEQUENCE", "JOINT_0")`, inadvertently flipping + // the polarity — the "!" should not be there. With the polarity + // inverted, properly-configured machines (which set HOME_SEQUENCE in + // [JOINT_0]) lose the halui.home-all convenience pin. + if (inifile.isSet("HOME_SEQUENCE", "JOINT_0")) { have_home_all = 1; }