From 9cc9b1d144974ca762d074f1fa206a3b7e9f8c13 Mon Sep 17 00:00:00 2001 From: smathis Date: Tue, 13 May 2025 14:44:49 +0200 Subject: [PATCH] Added explanation why the return status of doPoll is not used in the enable function. --- src/masterMacsAxis.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/masterMacsAxis.cpp b/src/masterMacsAxis.cpp index 8acd86e..eb6e5ba 100644 --- a/src/masterMacsAxis.cpp +++ b/src/masterMacsAxis.cpp @@ -1045,8 +1045,6 @@ asynStatus masterMacsAxis::enable(bool on) { // Status of parameter library operations asynStatus pl_status = asynSuccess; - bool moving = false; - // ========================================================================= /* @@ -1056,6 +1054,13 @@ asynStatus masterMacsAxis::enable(bool on) { */ targetReachedUninitialized_ = true; + /* + Continue regardless of the status returned by the poll; we just want to + find out whether the motor is currently moving or not. If the poll + function fails before it can determine that, it is assumed that the motor + is not moving. + */ + bool moving = false; doPoll(&moving); // If the axis is currently moving, it cannot be disabled. Ignore the