aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-11-08 09:29:38 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-11-08 09:29:38 -0500
commit5e6127869ab767dcc39642af09e08c79efc84888 (patch)
tree46774356127aae1622f3ba77776fc320b4854110 /klippy/mcu.py
parent3b5b895a10a186ef126c6fbcb50835827b6a6471 (diff)
downloadkutter-5e6127869ab767dcc39642af09e08c79efc84888.tar.gz
kutter-5e6127869ab767dcc39642af09e08c79efc84888.tar.xz
kutter-5e6127869ab767dcc39642af09e08c79efc84888.zip
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r--klippy/mcu.py4
1 files changed, 2 insertions, 2 deletions
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