performance optimization

This commit is contained in:
Nikolay Khabarov
2017-06-11 02:19:21 +03:00
parent 65695fe53d
commit 0fe98f4cca
2 changed files with 48 additions and 44 deletions
+5 -2
View File
@@ -145,8 +145,11 @@ def move(generator):
dma.add_set_clear(pins_to_set, pins_to_clear)
continue
pins = 0
k = int(round(min(x for x in (tx, ty, tz, te) if x is not None)
* US_IN_SECONDS))
m = None
for i in (tx, ty, tz, te):
if i is not None and (m is None or i < m):
m = i
k = int(round(m * US_IN_SECONDS))
if tx is not None:
pins |= STEP_PIN_MASK_X
if ty is not None: