From 402a2b91cebeb0363dd0fb782d9e84f01be48b6b Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 25 Jul 2021 17:08:15 +0200 Subject: [PATCH] Define Motion::PlanMove/PlanMoveTo as constexpr --- src/modules/motion.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/motion.h b/src/modules/motion.h index 109bc96..e33ed60 100644 --- a/src/modules/motion.h +++ b/src/modules/motion.h @@ -123,7 +123,7 @@ public: /// be supplied as the first template argument: PlanMoveTo(pos, rate). /// @see PlanMoveTo, unitToSteps template - void PlanMoveTo(AxisUnit pos, AxisUnit feedrate) { + constexpr void PlanMoveTo(AxisUnit pos, AxisUnit feedrate) { PlanMoveTo(A, pos.v, feedrate.v); } @@ -131,7 +131,7 @@ public: /// needs to be supplied as the first template argument: PlanMoveTo(pos, rate). /// @see PlanMoveTo, unitToSteps template - void PlanMoveTo(config::Unit pos, + constexpr void PlanMoveTo(config::Unit pos, config::Unit feedrate) { static_assert(B == axisParams[A].unitBase, "incorrect unit base"); PlanMoveTo( @@ -152,7 +152,7 @@ public: /// be supplied as the first template argument: PlanMove(pos, rate). /// @see PlanMove, unitToSteps template - void PlanMove(AxisUnit delta, AxisUnit feedrate) { + constexpr void PlanMove(AxisUnit delta, AxisUnit feedrate) { PlanMove(A, delta.v, feedrate.v); } @@ -160,7 +160,7 @@ public: /// be supplied as the first template argument: PlanMove(pos, rate). /// @see PlanMove, unitToSteps template - void PlanMove(config::Unit delta, + constexpr void PlanMove(config::Unit delta, config::Unit feedrate) { static_assert(B == axisParams[A].unitBase, "incorrect unit base"); PlanMove(