From 1a2034f545bd5916399a246a5529999974870036 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Wed, 11 May 2022 01:25:19 +0200 Subject: [PATCH] motion: Allow to get the motion controller for any axis --- src/modules/motion.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/motion.h b/src/modules/motion.h index a74f7f7..15c3ec5 100644 --- a/src/modules/motion.h +++ b/src/modules/motion.h @@ -340,6 +340,11 @@ public: return axisData[axis].drv; } + /// @returns the controller associated with the particular axis + inline const pulse_gen::PulseGen &CtrlForAxis(Axis axis) const { + return axisData[axis].ctrl; + } + private: struct AxisData { TMC2130 drv; ///< Motor driver