Use new dbLink APIs instead of checking link.type
This commit is contained in:
@@ -51,10 +51,9 @@ epicsExportAddress(dset, devAiSoft);
|
||||
|
||||
static long init_record(aiRecord *prec)
|
||||
{
|
||||
if (prec->inp.type == CONSTANT) {
|
||||
if (recGblInitConstantLink(&prec->inp, DBF_DOUBLE, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
}
|
||||
if (recGblInitConstantLink(&prec->inp, DBF_DOUBLE, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -62,9 +61,6 @@ static long read_ai(aiRecord *prec)
|
||||
{
|
||||
double val;
|
||||
|
||||
if (prec->inp.type == CONSTANT)
|
||||
return 2;
|
||||
|
||||
if (!dbGetLink(&prec->inp, DBR_DOUBLE, &val, 0, 0)) {
|
||||
|
||||
/* Apply smoothing algorithm */
|
||||
@@ -76,7 +72,7 @@ static long read_ai(aiRecord *prec)
|
||||
prec->udf = FALSE;
|
||||
prec->dpvt = &devAiSoft; /* Any non-zero value */
|
||||
|
||||
if (prec->tsel.type == CONSTANT &&
|
||||
if (dbLinkIsConstant(&prec->tsel) &&
|
||||
prec->tse == epicsTimeEventDeviceTime)
|
||||
dbGetTimeStamp(&prec->inp, &prec->time);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user