From ebcf99ac5608fec484e3d351b26df6033d90ad39 Mon Sep 17 00:00:00 2001 From: smathis Date: Wed, 17 Sep 2025 12:34:47 +0200 Subject: [PATCH] Updated sinqMotor to 1.5.5 --- sinqMotor | 2 +- src/masterMacsAxis.cpp | 38 ++++++++++++++++++++++++++------------ src/masterMacsAxis.h | 8 ++++---- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/sinqMotor b/sinqMotor index 902b18d..6dc2b13 160000 --- a/sinqMotor +++ b/sinqMotor @@ -1 +1 @@ -Subproject commit 902b18d03860e56e61f7875b48185881c7aad093 +Subproject commit 6dc2b131f7873d9408081430fa68a39cfe200ae6 diff --git a/src/masterMacsAxis.cpp b/src/masterMacsAxis.cpp index e1f6c92..e1c3270 100644 --- a/src/masterMacsAxis.cpp +++ b/src/masterMacsAxis.cpp @@ -85,7 +85,14 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage, } masterMacsAxis::masterMacsAxis(masterMacsController *pC, int axisNo) - : sinqAxis(pC, axisNo), pC_(pC) { + : sinqAxis(pC, axisNo), pC_(pC), + pMasterMacsA_(std::make_unique((masterMacsAxisImpl){ + .axisStatus = std::bitset<16>(0), + .axisError = std::bitset<16>(0), + .waitForHandshake = false, + .timeAtHandshake = 0, + .targetReachedUninitialized = true, + })) { asynStatus status = asynSuccess; @@ -118,14 +125,6 @@ masterMacsAxis::masterMacsAxis(masterMacsController *pC, int axisNo) // Collect all axes into this list which will be used in the hook function axes.push_back(this); - pMasterMacsA_ = std::make_unique((masterMacsAxisImpl){ - .axisStatus = std::bitset<16>(0), - .axisError = std::bitset<16>(0), - .waitForHandshake = false, - .timeAtHandshake = 0, - .targetReachedUninitialized = true, - }); - // masterMacs motors can always be disabled status = pC_->setIntegerParam(axisNo_, pC_->motorCanDisable(), 1); if (status != asynSuccess) { @@ -688,6 +687,11 @@ asynStatus masterMacsAxis::doMove(double position, int relative, double minVelocity, double maxVelocity, double acceleration) { + // Suppress unused variable warning + (void)minVelocity; + (void)maxVelocity; + (void)acceleration; + // Status of read-write-operations of ASCII commands to the controller asynStatus status = asynSuccess; @@ -790,6 +794,9 @@ asynStatus masterMacsAxis::doMove(double position, int relative, asynStatus masterMacsAxis::stop(double acceleration) { + // Suppress unused variable warning + (void)acceleration; + asynStatus status = pC_->write(axisNo_, 00, "8"); if (status != asynSuccess) { setAxisParamChecked(this, motorStatusProblem, true); @@ -845,13 +852,19 @@ asynStatus masterMacsAxis::nodeReset() { /* Home the axis. On absolute encoder systems, this is a no-op */ -asynStatus masterMacsAxis::doHome(double min_velocity, double max_velocity, +asynStatus masterMacsAxis::doHome(double minVelocity, double maxVelocity, double acceleration, int forwards) { char response[pC_->MAXBUF_] = {0}; // ========================================================================= + // Suppress unused variable warning + (void)minVelocity; + (void)maxVelocity; + (void)acceleration; + (void)forwards; + getAxisParamChecked(this, encoderType, &response); // Only send the home command if the axis has an incremental encoder @@ -1246,8 +1259,9 @@ static const iocshArg CreateAxisArg0 = {"Controller name (e.g. mmacs1)", static const iocshArg CreateAxisArg1 = {"Axis number", iocshArgInt}; static const iocshArg *const CreateAxisArgs[] = {&CreateAxisArg0, &CreateAxisArg1}; -static const iocshFuncDef configMasterMacsCreateAxis = {"masterMacsAxis", 2, - CreateAxisArgs}; +static const iocshFuncDef configMasterMacsCreateAxis = { + "masterMacsAxis", 2, CreateAxisArgs, + "Create a new instance of a MasterMACS axis."}; static void configMasterMacsCreateAxisCallFunc(const iocshArgBuf *args) { masterMacsCreateAxis(args[0].sval, args[1].ival); } diff --git a/src/masterMacsAxis.h b/src/masterMacsAxis.h index 6404f3e..30abab3 100644 --- a/src/masterMacsAxis.h +++ b/src/masterMacsAxis.h @@ -57,13 +57,13 @@ class HIDDEN masterMacsAxis : public sinqAxis { * * @param position * @param relative - * @param min_velocity - * @param max_velocity + * @param minVelocity + * @param maxVelocity * @param acceleration * @return asynStatus */ - asynStatus doMove(double position, int relative, double min_velocity, - double max_velocity, double acceleration); + asynStatus doMove(double position, int relative, double minVelocity, + double maxVelocity, double acceleration); /** * @brief Implementation of the `stop` function from asynMotorAxis