Allow enabling / disabling the motor regardless of the status returned

by the poll.
This commit is contained in:
2025-05-13 14:39:08 +02:00
parent 8f11c52f95
commit 63a5fcd518

View File

@ -392,13 +392,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
switch (axStatus) {
case -6:
// Axis is stopping
// If the axis was already idle during the last poll, it is not moving
if (previousStatusDone == 0) {
*moving = true;
} else {
*moving = false;
}
*moving = true;
break;
case -5:
// Axis is deactivated
@ -1277,11 +1271,14 @@ asynStatus turboPmacAxis::enable(bool on) {
// Status of parameter library operations
asynStatus pl_status = asynSuccess;
/*
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;
rw_status = doPoll(&moving);
if (rw_status != asynSuccess) {
return rw_status;
}
doPoll(&moving);
// =========================================================================