Use new dbLink APIs instead of checking link.type

This commit is contained in:
Andrew Johnson
2016-08-27 16:30:48 -05:00
parent cca6a5d05a
commit 37b6cbb50c
43 changed files with 328 additions and 354 deletions

View File

@@ -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 {