You’re correct that I do not mean homing. I have no idea where that came from.
I was not aware that endstops already perform debounce checks. It’s relevant to this discussion in it shows other places where that type of code is used.
I was specifically talking about klippy/extras/buttons.py. Which is used by other code.
The primary interest I have is the filament_switch_sensor. The Magneto X comes with this sketchy macro to make up for either a hardware / sensor tolerance issue or the stupid accelerations it is capable of triggering a false detection.
Looking through the code, filament_switch_sensor registers a button with a callback under the hood. That button code just seems like the logical place for debounce code to live, but I’m not that familiar with Klipper internals.
Excluding everything that’s been said about how homing already, here’s a few links. Including multiple people using macros, and one manufacturer explicitly noting they implemented debounce on a separate microcontroller.
- "filament_switch_sensor" debounced with timeout
- Reddit - Dive into anything
- Debounce sketchy - Macro to get ticks?
- Filament runout pause drlay
- Smart Sensor for Orbiter v2 – ORBITER PROJECTS
- klipper_config/runout.cfg at master · zellneralex/klipper_config · GitHub
Edit:
I am aware that pull up resistors do not help with debounce, however that was the recommended solution in one of the discourse links I’ve provided. Which is why I noted it does not solve the problem.