ai: circuitpython — убраны keyword-аргументы (split(maxsplit), dict.update(**)): CircuitPython их не принимает
This commit is contained in:
@@ -194,8 +194,13 @@ def cmd_sweep_parts(a):
|
||||
n = max(2, int(parts[2]))
|
||||
dwell = max(0.01, int(parts[3]) / 1000.0)
|
||||
ratio = (f1 / f0) ** (1.0 / (n - 1))
|
||||
state.update(sweep=True, sweep_f0=f0, sweep_ratio=ratio,
|
||||
sweep_idx=0, sweep_n=n, sweep_dwell=dwell, sweep_t0=0.0)
|
||||
state["sweep"] = True
|
||||
state["sweep_f0"] = f0
|
||||
state["sweep_ratio"] = ratio
|
||||
state["sweep_idx"] = 0
|
||||
state["sweep_n"] = n
|
||||
state["sweep_dwell"] = dwell
|
||||
state["sweep_t0"] = 0.0
|
||||
cmd_f(str(int(round(f0))))
|
||||
print("OK SWEEP")
|
||||
|
||||
@@ -211,7 +216,7 @@ def handle(line, phase):
|
||||
line = line.strip()
|
||||
if not line:
|
||||
return False, phase
|
||||
parts = line.split(maxsplit=1)
|
||||
parts = line.split(None, 1) # позиционно: sep=None, maxsplit=1 (в CP нет kwargs!)
|
||||
cmd = parts[0].upper()
|
||||
a = parts[1] if len(parts) > 1 else ""
|
||||
if cmd == "F":
|
||||
|
||||
Reference in New Issue
Block a user