From 272e815522b0bc8e0806e052b73a5cc1af979cd7 Mon Sep 17 00:00:00 2001 From: Gareth Farrington Date: Thu, 20 Mar 2025 16:55:33 -0700 Subject: buttons: Debounce gcode_button and filament_switch_sensor (#6848) Add `debounce_delay` config option which sets the debounce time, defaults to 0 Signed-off-by: Gareth Farrington --- klippy/extras/filament_motion_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'klippy/extras/filament_motion_sensor.py') diff --git a/klippy/extras/filament_motion_sensor.py b/klippy/extras/filament_motion_sensor.py index fb886aa5..dd476d28 100644 --- a/klippy/extras/filament_motion_sensor.py +++ b/klippy/extras/filament_motion_sensor.py @@ -63,7 +63,7 @@ class EncoderSensor: def _extruder_pos_update_event(self, eventtime): extruder_pos = self._get_extruder_pos(eventtime) # Check for filament runout - self.runout_helper.note_filament_present( + self.runout_helper.note_filament_present(eventtime, extruder_pos < self.filament_runout_pos) return eventtime + CHECK_RUNOUT_TIMEOUT def encoder_event(self, eventtime, state): @@ -71,7 +71,7 @@ class EncoderSensor: self._update_filament_runout_pos(eventtime) # Check for filament insertion # Filament is always assumed to be present on an encoder event - self.runout_helper.note_filament_present(True) + self.runout_helper.note_filament_present(eventtime, True) def load_config_prefix(config): return EncoderSensor(config) -- cgit v1.2.3-70-g09d2