Skip to content

Commit

Permalink
ecmc.updated param changed to uint64 (asyn >=4.37)
Browse files Browse the repository at this point in the history
  • Loading branch information
anderssandstrom committed Mar 8, 2021
1 parent b364146 commit b9c160d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Release Notes
===
# ECMC master
* ecmc-updated param changed to uint64 if asyn version >=4.37
* Fix printout of plugin plc functions info for funcs with more than 6 args.

# ECMC 6.3.1
Expand Down
28 changes: 26 additions & 2 deletions devEcmcSup/com/ecmcCom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@
#include "../main/ecmcDefinitions.h"
#include "../main/ecmcMainThread.h"

//Below for asyn version and 64 bit ints
#include "asynPortDriver.h"
#ifndef VERSION_INT
# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
#endif

#define VERSION_INT_4_37 VERSION_INT(4,37,0,0)
#define ECMC_ASYN_VERSION_INT VERSION_INT(ASYN_VERSION,ASYN_REVISION,ASYN_MODIFICATION,0)

#if ECMC_ASYN_VERSION_INT >= VERSION_INT_4_37
#define ECMC_ASYN_ASYNPARAMINT64
#endif


// TODO: REMOVE GLOBALS
#include "../main/ecmcGlobalsExtern.h"

Expand Down Expand Up @@ -577,12 +591,22 @@ int ecmcAddDefaultAsynParams() {

// ECMC_ASYN_MAIN_PAR_UPDATE_READY_NAME
name = ECMC_ASYN_MAIN_PAR_UPDATE_READY_NAME;
#ifdef ECMC_ASYN_ASYNPARAMINT64
paramTemp = asynPort->addNewAvailParam(name,
asynParamInt64Array,
(uint8_t *)(&ecmcUpdatedCounter),
8,
ECMC_EC_U64,
0);
#else
paramTemp = asynPort->addNewAvailParam(name,
asynParamInt32Array,
(uint8_t *)(&ecmcUpdatedCounter),
4,
ECMC_EC_S32,
ECMC_EC_U32,
0);
#endif //ECMC_ASYN_ASYNPARAMINT64

if(!paramTemp) {
LOGERR(
"%s/%s:%d: ERROR: Add create default parameter for %s failed.\n",
Expand All @@ -591,7 +615,7 @@ int ecmcAddDefaultAsynParams() {
__LINE__,
name);
return ERROR_MAIN_ASYN_CREATE_PARAM_FAIL;
}
}
paramTemp->setAllowWriteToEcmc(false);
paramTemp->setArrayCheckSize(false);
paramTemp->refreshParam(1);
Expand Down
2 changes: 1 addition & 1 deletion devEcmcSup/main/ecmcGlobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int controllerError = -1;
int controllerErrorOld = -2;
int controllerReset = 0;
const char *controllerErrorMsg = "NO_ERROR";
int32_t ecmcUpdatedCounter = 0;
uint64_t ecmcUpdatedCounter = 0;
int asynSkipCyclesFastest = -1;
int asynSkipUpdateCounterFastest = 0;
int ecTimeoutSeconds = EC_START_TIMEOUT_S;
Expand Down
2 changes: 1 addition & 1 deletion devEcmcSup/main/ecmcGlobalsExtern.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern int controllerError;
extern int controllerErrorOld;
extern int controllerReset;
extern const char *controllerErrorMsg;
extern int32_t ecmcUpdatedCounter;
extern uint64_t ecmcUpdatedCounter;
extern int asynSkipCyclesFastest;
extern int asynSkipUpdateCounterFastest;
extern int ecTimeoutSeconds;
Expand Down

0 comments on commit b9c160d

Please sign in to comment.