From 5e6127869ab767dcc39642af09e08c79efc84888 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 8 Nov 2016 09:29:38 -0500 Subject: [PATCH] mcu: Do not invert the direction of pullup pins by default A pullup setting on an input pin (ie, '^') should enable the hardware pullup resistor, but it should not invert the trigger level (ie, it should remain trigger on high). Those that need to change the trigger level (ie, trigger on low) must now do that explicitly (ie, '^!'). This makes the code match what other firmwares do. Signed-off-by: Kevin O'Connor --- config/avrsim.cfg | 6 +++--- config/makergear-m2-2012.cfg | 6 +++--- klippy/mcu.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/avrsim.cfg b/config/avrsim.cfg index ffd2fa2b..eed54e72 100644 --- a/config/avrsim.cfg +++ b/config/avrsim.cfg @@ -11,7 +11,7 @@ enable_pin: ar25 step_distance: .0225 max_velocity: 500 max_accel: 3000 -endstop_pin: ^!ar0 +endstop_pin: ^ar0 position_min: -0.25 position_endstop: 0 position_max: 200 @@ -24,7 +24,7 @@ enable_pin: ar25 step_distance: .0225 max_velocity: 500 max_accel: 3000 -endstop_pin: ^!ar1 +endstop_pin: ^ar1 position_min: -0.25 position_endstop: 0 position_max: 200 @@ -37,7 +37,7 @@ enable_pin: ar25 step_distance: .005 max_velocity: 250 max_accel: 30 -endstop_pin: ^!ar2 +endstop_pin: ^ar2 position_min: 0.1 position_endstop: 0.5 position_max: 200 diff --git a/config/makergear-m2-2012.cfg b/config/makergear-m2-2012.cfg index a3a9173e..1db7ee1b 100644 --- a/config/makergear-m2-2012.cfg +++ b/config/makergear-m2-2012.cfg @@ -10,7 +10,7 @@ enable_pin: !PA7 step_distance: .0225 max_velocity: 500 max_accel: 3000 -endstop_pin: ^PB6 +endstop_pin: ^!PB6 homing_speed: 50.0 homing_stepper_phases: 32 homing_endstop_accuracy: .200 @@ -25,7 +25,7 @@ enable_pin: !PA6 step_distance: .0225 max_velocity: 500 max_accel: 3000 -endstop_pin: ^PB5 +endstop_pin: ^!PB5 homing_speed: 50.0 homing_stepper_phases: 32 homing_endstop_accuracy: .200 @@ -40,7 +40,7 @@ enable_pin: !PA5 step_distance: .005 max_velocity: 250 max_accel: 30 -endstop_pin: ^PB4 +endstop_pin: ^!PB4 homing_speed: 4.0 homing_retract_dist: 2.0 homing_stepper_phases: 32 diff --git a/klippy/mcu.py b/klippy/mcu.py index 93eacc23..7e172f63 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -9,10 +9,10 @@ import serialhdl, pins, chelper def parse_pin_extras(pin, can_pullup=False): pullup = invert = 0 if can_pullup and pin.startswith('^'): - pullup = invert = 1 + pullup = 1 pin = pin[1:].strip() if pin.startswith('!'): - invert = invert ^ 1 + invert = 1 pin = pin[1:].strip() return pin, pullup, invert