Modify soft devices to synchronize TSEL=-2 timestamps
Use dbLinkDoLocked() to ensure a timestamp set by TSEL=-2 comes from the same update as the value.
This commit is contained in:
@@ -54,13 +54,25 @@ static long init_record(mbbiDirectRecord *prec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long read_mbbi(mbbiDirectRecord *prec)
|
||||
static long readLocked(struct link *pinp, void *dummy)
|
||||
{
|
||||
if (!dbGetLink(&prec->inp, DBR_USHORT, &prec->val, 0, 0)) {
|
||||
mbbiDirectRecord *prec = (mbbiDirectRecord *) pinp->precord;
|
||||
|
||||
if (!dbGetLink(pinp, DBR_USHORT, &prec->val, 0, 0)) {
|
||||
prec->udf = FALSE;
|
||||
if (dbLinkIsConstant(&prec->tsel) &&
|
||||
prec->tse == epicsTimeEventDeviceTime)
|
||||
dbGetTimeStamp(&prec->inp, &prec->time);
|
||||
dbGetTimeStamp(pinp, &prec->time);
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
static long read_mbbi(mbbiDirectRecord *prec)
|
||||
{
|
||||
long status = dbLinkDoLocked(&prec->inp, readLocked, NULL);
|
||||
|
||||
if (status == S_db_noLSET)
|
||||
status = readLocked(&prec->inp, NULL);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user