diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-02-27 11:07:51 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-02-27 11:13:21 -0500 |
commit | dddfb681c737c5623dc270bf6c8e59fd3b13b092 (patch) | |
tree | c295b1c5837c2f1d6f6f569b595b2506cd2f69b7 /klippy/pins.py | |
parent | b6589406d46186bc9ae76a3db49363c5168e30e9 (diff) | |
download | kutter-dddfb681c737c5623dc270bf6c8e59fd3b13b092.tar.gz kutter-dddfb681c737c5623dc270bf6c8e59fd3b13b092.tar.xz kutter-dddfb681c737c5623dc270bf6c8e59fd3b13b092.zip |
pins: Add support for pull down resistors
Add initial support for selecting pull down resistors (for
micro-controllers that support it).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/pins.py')
-rw-r--r-- | klippy/pins.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/klippy/pins.py b/klippy/pins.py index 47bd87b5..90679ad1 100644 --- a/klippy/pins.py +++ b/klippy/pins.py @@ -215,8 +215,10 @@ class PrinterPins: share_type=None): desc = pin_desc.strip() pullup = invert = 0 - if can_pullup and desc.startswith('^'): + if can_pullup and (desc.startswith('^') or desc.startswith('~')): pullup = 1 + if desc.startswith('~'): + pullup = -1 desc = desc[1:].strip() if can_invert and desc.startswith('!'): invert = 1 @@ -227,7 +229,7 @@ class PrinterPins: chip_name, pin = [s.strip() for s in desc.split(':', 1)] if chip_name not in self.chips: raise error("Unknown pin chip name '%s'" % (chip_name,)) - if [c for c in '^!: ' if c in pin]: + if [c for c in '^~!: ' if c in pin]: format = "" if can_pullup: format += "[^] " |