From 38d7b9ada0d61971fdaf3e853892e7fb4051b36a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 26 Jan 2018 14:27:55 -0500 Subject: buttons: Add initial support for detecting button presses Add mcu support for periodically polling for a button press. Add host code support for registering buttons and invoking callbacks for them. Signed-off-by: Kevin O'Connor --- klippy/pins.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'klippy/pins.py') diff --git a/klippy/pins.py b/klippy/pins.py index eec0df84..ac8fd8bd 100644 --- a/klippy/pins.py +++ b/klippy/pins.py @@ -199,8 +199,9 @@ class PrinterPins: self.chips = {} self.active_pins = {} def lookup_pin(self, pin_type, pin_desc, share_type=None): - can_invert = pin_type in ['stepper', 'endstop', 'digital_out', 'pwm'] - can_pullup = pin_type == 'endstop' + can_invert = pin_type in ['stepper', 'endstop', 'digital_in', + 'digital_out', 'pwm'] + can_pullup = pin_type in ['endstop', 'digital_in'] desc = pin_desc.strip() pullup = invert = 0 if can_pullup and desc.startswith('^'): -- cgit v1.2.3-70-g09d2