Compare commits

...

4 Commits

Author SHA1 Message Date
275672aaef Removed lock in reset and replaced it with wakeupPoller call
Trying to lock the controller from one of its axes may lead to
segfaults, hence it is not advisable.
2025-05-16 15:50:26 +02:00
61c5ec749e Merge branch 'main' of gitea.psi.ch:lin-epics-modules/sinqMotor 2025-05-15 14:26:15 +02:00
1cf4b9ab25 Made some functions virtual so they can be overwritten 2025-05-15 14:26:00 +02:00
a0b674b26e Made some functions virtual so they can be overwritten 2025-05-15 14:24:53 +02:00
2 changed files with 9 additions and 17 deletions

View File

@ -543,15 +543,7 @@ asynStatus sinqAxis::reset() {
if (status == asynSuccess) { if (status == asynSuccess) {
// Perform some fast polls // Perform some fast polls
pC_->lock(); pC_->wakeupPoller();
bool moving = false;
for (int i = 0; i < 5; i++) {
epicsThreadSleep(pC_->movingPollPeriod());
if (poll(&moving) == asynSuccess) {
break;
}
}
pC_->unlock();
} }
status = assertConnected(); status = assertConnected();

View File

@ -49,7 +49,7 @@ class epicsShareClass sinqAxis : public asynMotorAxis {
the parameter library operation fails (in that case, returns the status of the parameter library operation fails (in that case, returns the status of
the failed operation. the failed operation.
*/ */
asynStatus poll(bool *moving); virtual asynStatus poll(bool *moving);
/** /**
* @brief Implementation of the "proper", device-specific poll method. This * @brief Implementation of the "proper", device-specific poll method. This
@ -79,7 +79,7 @@ class epicsShareClass sinqAxis : public asynMotorAxis {
the parameter library operation fails (in that case, returns the failed the parameter library operation fails (in that case, returns the failed
operation status). operation status).
*/ */
asynStatus move(double position, int relative, double minVelocity, virtual asynStatus move(double position, int relative, double minVelocity,
double maxVelocity, double acceleration); double maxVelocity, double acceleration);
/** /**
@ -143,8 +143,8 @@ class epicsShareClass sinqAxis : public asynMotorAxis {
the parameter library operation fails (in that case, returns the failed the parameter library operation fails (in that case, returns the failed
operation status). operation status).
*/ */
asynStatus home(double minVelocity, double maxVelocity, double acceleration, virtual asynStatus home(double minVelocity, double maxVelocity,
int forwards); double acceleration, int forwards);
/** /**
* @brief Implementation of the "proper", device-specific home method. This * @brief Implementation of the "proper", device-specific home method. This
@ -170,7 +170,7 @@ class epicsShareClass sinqAxis : public asynMotorAxis {
* *
* @return asynStatus * @return asynStatus
*/ */
asynStatus reset(); virtual asynStatus reset();
/** /**
* @brief Implementation of the "proper", device-specific `reset` method. * @brief Implementation of the "proper", device-specific `reset` method.
@ -240,7 +240,7 @@ class epicsShareClass sinqAxis : public asynMotorAxis {
used to get the values for the timeout calculation failed, return that used to get the values for the timeout calculation failed, return that
status, otherwise return asynSuccess. status, otherwise return asynSuccess.
*/ */
asynStatus startMovTimeoutWatchdog(); virtual asynStatus startMovTimeoutWatchdog();
/** /**
* @brief Check if the watchdog timed out * @brief Check if the watchdog timed out
@ -274,7 +274,7 @@ class epicsShareClass sinqAxis : public asynMotorAxis {
* @return asynStatus Return asynError, if the watchdog timed out, * @return asynStatus Return asynError, if the watchdog timed out,
and asynSuccess otherwise. and asynSuccess otherwise.
*/ */
asynStatus checkMovTimeoutWatchdog(bool moving); virtual asynStatus checkMovTimeoutWatchdog(bool moving);
/** /**
* @brief Enable / disable the watchdog. Also available in the IOC shell * @brief Enable / disable the watchdog. Also available in the IOC shell