From 69499322da1ee363fc76ce87268bb7bc0a40fd10 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Tue, 8 Feb 2022 09:39:26 -1000 Subject: [PATCH] Fixed problem when converting a TMC2208 machine --- Grbl_Esp32/src/Motors/TrinamicUartDriverClass.cpp | 2 ++ converter.py | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Grbl_Esp32/src/Motors/TrinamicUartDriverClass.cpp b/Grbl_Esp32/src/Motors/TrinamicUartDriverClass.cpp index 6409f1e6..15bd9bd9 100644 --- a/Grbl_Esp32/src/Motors/TrinamicUartDriverClass.cpp +++ b/Grbl_Esp32/src/Motors/TrinamicUartDriverClass.cpp @@ -71,6 +71,7 @@ namespace Motors { init_step_dir_pins(); // from StandardStepper config_message(); +#ifndef NATIVE tmcstepper->begin(); _has_errors = !test(); // Try communicating with motor. Prints an error if there is a problem. @@ -96,6 +97,7 @@ namespace Motors { // core ); } +#endif } /* diff --git a/converter.py b/converter.py index 1844107a..2d5c5a67 100644 --- a/converter.py +++ b/converter.py @@ -32,11 +32,9 @@ def convertMachine(baseName, verbose=True, extraArgs=None): if app.returncode == 0: cmd = [ '.pio/build/' + pioEnv + '/program' ] out_filename = "yaml/" + Path(baseName).stem + ".yaml" - proc = subprocess.run(cmd, env=env, stdout=open(out_filename, "w"), bufsize=1) + proc = subprocess.run(cmd, env=env, stdout=open(out_filename, "w"), stderr=subprocess.STDOUT, bufsize=1) print("FluidNC Configuration written to", out_filename) - # Sometimes proc.returncode seems to be 245 even when things are okay, - # so we just return 0. - return 0 + return proc.returncode else: out_filename = "yaml/" + Path(baseName).stem + ".ERROR" open(out_filename, "w")