endstop_phase: Use config.getintlist() for trigger_phase config option

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-08-19 14:59:53 -04:00
parent 58dedb6b16
commit 7f82dcb442
1 changed files with 1 additions and 5 deletions

View File

@ -67,11 +67,7 @@ class EndstopPhase:
self.endstop_phase = None self.endstop_phase = None
trigger_phase = config.get('trigger_phase', None) trigger_phase = config.get('trigger_phase', None)
if trigger_phase is not None: if trigger_phase is not None:
try: p, ps = config.getintlist('trigger_phase', sep='/', count=2)
p, ps = [int(v.strip()) for v in trigger_phase.split('/')]
except:
raise config.error("Unable to parse trigger_phase '%s'"
% (trigger_phase,))
if p >= ps: if p >= ps:
raise config.error("Invalid trigger_phase '%s'" raise config.error("Invalid trigger_phase '%s'"
% (trigger_phase,)) % (trigger_phase,))