Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working with @p3p on an issue in the simulator where we were triggering the kill pin, we noticed a very pronounced delay. In the case of the simulator linux HAL, the idle loop rate was 500hz and therefore this added significant dwell to the execution of the stop function. Looking at the code, we see the delay is called in cycles, not ms. This function cannot use the safe_delay calls as it is inside the manage inactivity function. The consensus in discussion on discord is that as a safety function, we should only be debouncing for signal noise, not accidental press. Most common actuation of a safety button is a rapid slap, not a press and hold.
Therefore we have 2 options. 1. Reduce the time to whats reasonable as a debounce or 2. Count ticks. For the moment, I opted for the simpler reduction and allowed an override for especially noisy systems. I updated the comment in order to point out explicitly that this should function as a debounce.