diff --git a/src/modules/motion.h b/src/modules/motion.h index b2c3c5d..e2bd88d 100644 --- a/src/modules/motion.h +++ b/src/modules/motion.h @@ -185,6 +185,23 @@ public: axisData[axis].ctrl.SetAcceleration(accel); } + /// Set acceleration for the selected axis, but using AxisUnit. The Axis needs to + /// be supplied as the first template argument: SetAcceleration(accel). + /// @see SetAcceleration, unitToSteps + template + void SetAcceleration(AxisUnit accel) { + SetAcceleration(A, accel.v); + } + + /// Set acceleration for the selected axis, but using physical units. The Axis needs to + /// be supplied as the first template argument: SetAcceleration(accel). + /// @param axis axis affected + /// @param accel acceleration + template + void SetAcceleration(config::Unit accel) { + SetAcceleration(unitToAxisUnit>(accel)); + } + /// Get current jerk for the selected axis /// @param axis axis affected /// @returns jerk