Removed exit(-1) from init

When the initialization fails, the motor will now try again during each
poll.
This commit is contained in:
2025-05-23 11:51:33 +02:00
parent 738780f897
commit 18bc3dfc5f
4 changed files with 200 additions and 73 deletions

View File

@@ -1,6 +1,9 @@
#ifndef turboPmacAXIS_H
#define turboPmacAXIS_H
#include "sinqAxis.h"
#include <memory>
struct turboPmacAxisImpl;
// Forward declaration of the controller class to resolve the cyclic dependency
// between the controller and the axis .h-file. See
@@ -123,14 +126,24 @@ class turboPmacAxis : public sinqAxis {
*/
asynStatus handleError(int error, char *userMessage, int sizeUserMessage);
protected:
/**
* @brief Check if the axis needs to run its initialization function
*
* @return true
* @return false
*/
bool needInit();
/**
* @brief Instruct the axis to run its init() function during the next poll
*
* @param needInit
*/
void setNeedInit(bool needInit);
private:
turboPmacController *pC_;
bool waitForHandshake_;
time_t timeAtHandshake_;
// The axis status is used when enabling / disabling the motor
int axisStatus_;
std::unique_ptr<turboPmacAxisImpl> pTurboPmacA_;
};
#endif