Skip to content

Fix issues in 'momentary2nist' and 'toggle2nist' components - #4576

Merged
grandixximo merged 1 commit into
LinuxCNC:masterfrom
Sigma1912:2nist_comps-fix-issues
Sep 24, 2026
Merged

grandixximo merged 1 commit into
LinuxCNC:masterfrom
Sigma1912:2nist_comps-fix-issues

Conversation

@Sigma1912

Copy link
Copy Markdown
Contributor
  • Both 'momentary2nist' and 'toggle2nist' suffer from a loose pulse_length counter that leads to 'on'-,'off'-signals getting cut short because the counter is not reset properly and counts when idling. Fix: The counter is now reset when the pins are changed and no longer counts when the component is idle.

  • 'toggle2nist' can endup being desynchronized when the toggle switch is flipped back and forth very fast. Fix: The input pin state is now compared to the state of the device so a switch position disagreeing with the device state will always trigger a change.

  • Both components now verify a succesful change in the device by comparing to the expected state rather than output pin values that change in idle.

  • For both components the idle state is now the default branch.

Comment thread src/hal/components/toggle2nist.comp Outdated
Comment thread src/hal/components/toggle2nist.comp Outdated
@Sigma1912
Sigma1912 force-pushed the 2nist_comps-fix-issues branch from 08c4bb9 to c3ee68f Compare September 20, 2026 14:56
Comment thread src/hal/components/toggle2nist.comp
Comment thread src/hal/components/toggle2nist.comp Outdated
Comment thread src/hal/components/toggle2nist.comp Outdated
Comment thread src/hal/components/momentary2nist.comp Outdated
- Both 'momentary2nist' and 'toggle2nist' suffer from a loose pulse_length counter that leads
to 'on'-,'off'-signals getting cut short because the counter is not reset properly and counts when idling.
Fix: The counter is now reset when the pins are changed and no longer counts when the component is idle.

- 'toggle2nist' can endup being desynchronized when the toggle switch is flipped back and forth very fast.
Fix: The input pin state is now compared to the state of the device so a switch position disagreeing with
the device state will always trigger a change.

- Both components now verify a succesful change in the device by comparing to the expected state rather than
  output pin values that change in idle.

- For both components the idle state is now the default branch.

- remove unnecessary debounce reset when waiting for device confirmation

- set max_pulse_length to a more suitable default value and make it the minimum for toggle2nist

- clarification in the description
@Sigma1912
Sigma1912 force-pushed the 2nist_comps-fix-issues branch from c3ee68f to c83e088 Compare September 21, 2026 14:24
@grandixximo
grandixximo merged commit f218ffb into LinuxCNC:master Sep 24, 2026
17 checks passed
@Sigma1912
Sigma1912 deleted the 2nist_comps-fix-issues branch September 25, 2026 08:38
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.

2 participants