Skip to content

Commit

Permalink
Letting the FP Univ module have the same interface for fine delay
Browse files Browse the repository at this point in the history
  • Loading branch information
rhong committed Sep 13, 2024
1 parent d99b411 commit f578b2b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions evrMrmApp/src/drvem.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ class epicsShareClass EVRMRM : public mrf::ObjectInst<EVRMRM, EVR>,
const void *isrLinuxPvt;
#endif

//get the pointer of the delay module
DelayModule* getDelayModule(int i){
if (size_t(i)<delays.size()){
return delays[i];
}else{
return NULL;
}
}

const Config * const conf;
volatile unsigned char * const base;
epicsUInt32 baselen;
Expand Down
14 changes: 14 additions & 0 deletions evrMrmApp/src/drvemOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ MRMOutput::setFineDelay(double val)
case OutputFP:
break;
case OutputFPUniv:
if (owner->getDelayModule(N/2) != NULL){
if (N%2 == 0){
owner->getDelayModule(N/2)->setDelay0(val);
}else{
owner->getDelayModule(N/2)->setDelay1(val);
}
}
break;
case OutputRB:
WRITE32(owner->base, RTMDELAY(N), ticks); break;
Expand All @@ -190,6 +197,13 @@ MRMOutput::fineDelay() const
case OutputFP:
break;
case OutputFPUniv:
if (owner->getDelayModule(N/2) != NULL){
if (N%2 == 0){
dly_val = owner->getDelayModule(N/2)->getDelay0();
}else{
dly_val = owner->getDelayModule(N/2)->getDelay1();
}
}
break;
case OutputRB:
epicsUInt32 ticks;
Expand Down

0 comments on commit f578b2b

Please sign in to comment.