From 20f3d6cd93a4dbf22414a317f27f7463b69805cd Mon Sep 17 00:00:00 2001 From: David Crocker Date: Sat, 27 Aug 2022 14:38:30 +0100 Subject: Support M917 on MB6XD --- src/GCodes/GCodes2.cpp | 4 ++-- src/Platform/Platform.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp index cb416160..d807702a 100644 --- a/src/GCodes/GCodes2.cpp +++ b/src/GCodes/GCodes2.cpp @@ -4268,7 +4268,7 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx case 906: // Set/report Motor currents case 913: // Set/report motor current percent -#if HAS_SMART_DRIVERS +#if HAS_SMART_DRIVERS || SUPPORT_CAN_EXPANSION case 917: // Set/report standstill motor current percentage #endif { @@ -4329,7 +4329,7 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx else { reply.copy( (code == 913) ? "Motor current % of normal - " -#if HAS_SMART_DRIVERS +#if HAS_SMART_DRIVERS || SUPPORT_CAN_EXPANSION : (code == 917) ? "Motor standstill current % of normal - " #endif : "Motor current (mA) - " diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp index 966906b5..e0331947 100644 --- a/src/Platform/Platform.cpp +++ b/src/Platform/Platform.cpp @@ -2666,7 +2666,7 @@ GCodeResult Platform::SetMotorCurrent(size_t axisOrExtruder, float currentOrPerc motorCurrentFraction[axisOrExtruder] = constrain(0.01 * currentOrPercent, 0.0, 1.0); break; -#if HAS_SMART_DRIVERS +#if HAS_SMART_DRIVERS || SUPPORT_CAN_EXPANSION case 917: standstillCurrentPercent[axisOrExtruder] = constrain(currentOrPercent, 0.0, 100.0); break; -- cgit v1.2.3