Compare commits

..

1 Commits

Author SHA1 Message Date
4e30331c92 Added disconnect handling to sinqMotor
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 6s
2026-01-22 09:52:24 +01:00

View File

@@ -245,6 +245,10 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
// Clear the communication // Clear the communication
setAxisParamChecked(this, motorStatusCommsError, false); setAxisParamChecked(this, motorStatusCommsError, false);
// Assume the motor is initially connected. During the poll, this value will
// be set to false if the motor is not connected.
setAxisParamChecked(this, motorConnected, true);
/* /*
The poll function is just a wrapper around doPoll and handles mainly the The poll function is just a wrapper around doPoll and handles mainly the
callParamCallbacks() function. This wrapper is used to make sure callParamCallbacks() function. This wrapper is used to make sure
@@ -252,6 +256,11 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
*/ */
poll_status = doPoll(moving); poll_status = doPoll(moving);
// Motor is not connected
if (poll_status == asynDisconnected) {
setAxisParamChecked(this, motorConnected, false);
}
/* /*
If the poll did not succeed OR if an error message is waiting, something If the poll did not succeed OR if an error message is waiting, something
went wrong and the motor has a status problem. Otherwise, delete the error went wrong and the motor has a status problem. Otherwise, delete the error