Added compiler flags for the C++ code and formatted README

This commit is contained in:
2025-12-23 13:27:14 +01:00
parent 0e2b5f5e93
commit 01a0239dfb
4 changed files with 62 additions and 25 deletions

View File

@@ -787,6 +787,10 @@ asynStatus turboPmacAxis::doMove(double position, int relative,
// =========================================================================
// Suppress unused variables warning
(void)minVelocity;
(void)acceleration;
getAxisParamChecked(this, motorEnableRBV, &enabled);
getAxisParamChecked(this, motorRecResolution, &motorRecResolution);
@@ -875,6 +879,9 @@ asynStatus turboPmacAxis::stop(double acceleration) {
// =========================================================================
// Suppress unused variables warning
(void)acceleration;
snprintf(command, sizeof(command), "M%2.2d=8", axisNo_);
status = pC_->writeRead(axisNo_, command, response, 0);
@@ -939,7 +946,7 @@ asynStatus turboPmacAxis::doReset() {
/*
Home the axis. On absolute encoder systems, this is a no-op
*/
asynStatus turboPmacAxis::doHome(double min_velocity, double max_velocity,
asynStatus turboPmacAxis::doHome(double minVelocity, double maxVelocity,
double acceleration, int forwards) {
// Status of read-write-operations of ASCII commands to the controller
@@ -950,6 +957,12 @@ asynStatus turboPmacAxis::doHome(double min_velocity, double max_velocity,
// =========================================================================
// Suppress unused variables 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

View File

@@ -61,17 +61,17 @@ turboPmacController::turboPmacController(const char *portName,
- REREAD_ENCODER_POSITION
- READ_CONFIG
*/
numExtraParams + NUM_turboPmac_DRIVER_PARAMS)
{
// The paramLib indices are populated with the calls to createParam
pTurboPmacC_ =
std::make_unique<turboPmacControllerImpl>((turboPmacControllerImpl){
.comTimeout = comTimeout,
.lastResponse = {0},
});
numExtraParams + NUM_turboPmac_DRIVER_PARAMS),
pTurboPmacC_(
std::make_unique<turboPmacControllerImpl>((turboPmacControllerImpl){
.comTimeout = comTimeout,
.lastResponse = {0},
.pasynInt32SyncIOipPort = nullptr, // Populated in constructor
.rereadEncoderPosition = 0, // Populated in constructor
.readConfig = 0, // Populated in constructor
.flushHardware = 0, // Populated in constructor
.limFromHardware = 0, // Populated in constructor
})) {
// Initialization of local variables
asynStatus status = asynSuccess;
@@ -573,7 +573,8 @@ static const iocshArg *const CreateControllerArgs[] = {
&CreateControllerArg0, &CreateControllerArg1, &CreateControllerArg2,
&CreateControllerArg3, &CreateControllerArg4, &CreateControllerArg5};
static const iocshFuncDef configTurboPmacCreateController = {
"turboPmacController", 6, CreateControllerArgs};
"turboPmacController", 6, CreateControllerArgs,
"Create a new instance of a TurboPMAC controller."};
static void configTurboPmacCreateControllerCallFunc(const iocshArgBuf *args) {
turboPmacCreateController(args[0].sval, args[1].sval, args[2].ival,
args[3].dval, args[4].dval, args[5].dval);