mirror of https://github.com/Desuuuu/klipper.git
pins: Don't pass mcu_freq to update_command()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
2a6a9eb52f
commit
52156d2c41
|
@ -153,8 +153,7 @@ class KeyboardReader:
|
||||||
self.output("Eval: %s" % (line,))
|
self.output("Eval: %s" % (line,))
|
||||||
if self.pins is not None:
|
if self.pins is not None:
|
||||||
try:
|
try:
|
||||||
line = pins.update_command(
|
line = pins.update_command(line, self.pins).strip()
|
||||||
line, self.mcu_freq, self.pins).strip()
|
|
||||||
except:
|
except:
|
||||||
self.output("Unable to map pin: %s" % (line,))
|
self.output("Unable to map pin: %s" % (line,))
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -612,8 +612,7 @@ class MCU:
|
||||||
updated_cmds = []
|
updated_cmds = []
|
||||||
for cmd in self._config_cmds:
|
for cmd in self._config_cmds:
|
||||||
try:
|
try:
|
||||||
updated_cmds.append(pins.update_command(
|
updated_cmds.append(pins.update_command(cmd, pnames))
|
||||||
cmd, self._mcu_freq, pnames))
|
|
||||||
except:
|
except:
|
||||||
raise pins.error("Unable to translate pin name: %s" % (cmd,))
|
raise pins.error("Unable to translate pin name: %s" % (cmd,))
|
||||||
self._config_cmds = updated_cmds
|
self._config_cmds = updated_cmds
|
||||||
|
|
|
@ -161,7 +161,7 @@ def get_pin_map(mcu, mapping_name=None):
|
||||||
|
|
||||||
# Translate pin names in a firmware command
|
# Translate pin names in a firmware command
|
||||||
re_pin = re.compile(r'(?P<prefix>[ _]pin=)(?P<name>[^ ]*)')
|
re_pin = re.compile(r'(?P<prefix>[ _]pin=)(?P<name>[^ ]*)')
|
||||||
def update_command(cmd, mcu_freq, pmap):
|
def update_command(cmd, pmap):
|
||||||
def pin_fixup(m):
|
def pin_fixup(m):
|
||||||
return m.group('prefix') + str(pmap[m.group('name')])
|
return m.group('prefix') + str(pmap[m.group('name')])
|
||||||
return re_pin.sub(pin_fixup, cmd)
|
return re_pin.sub(pin_fixup, cmd)
|
||||||
|
|
Loading…
Reference in New Issue