Skip to content

Commit

Permalink
Changes to use typed dset and drvet if available
Browse files Browse the repository at this point in the history
  • Loading branch information
anjohnson committed Oct 23, 2018
1 parent 56530e4 commit a7e0ff4
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 170 deletions.
2 changes: 2 additions & 0 deletions drvIpac/Makefile
Expand Up @@ -32,6 +32,8 @@ LIBSRCS_vxWorks-pentium += drvAtc40.c

LIBSRCS_vxWorks += $(LIBSRCS_$(T_A))

USR_CFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET -DUSE_TYPED_DRVET

Ipac_LIBS += $(EPICS_BASE_IOC_LIBS)

include $(TOP)/configure/RULES
14 changes: 7 additions & 7 deletions drvIpac/drvIpac.c
Expand Up @@ -82,12 +82,12 @@ LOCAL ipac_carrier_t nullCarrier = {

/* Driver Support Entry Table */

LOCAL int ipacInitialise(int after);
LOCAL long ipacInitialise(int after);

struct drvet drvIpac = {
2,
(DRVSUPFUN) ipacReport,
(DRVSUPFUN) ipacInitialise
drvet drvIpac = {
2,
ipacReport,
ipacInitialise
};
epicsExportAddress(drvet, drvIpac);

Expand Down Expand Up @@ -782,7 +782,7 @@ int ipmIntConnect (
*/

int ipacReport (
long ipacReport (
int interest
) {
int carrier, slot;
Expand Down Expand Up @@ -836,7 +836,7 @@ int ipacReport (
*/

LOCAL int ipacInitialise (
LOCAL long ipacInitialise (
int after
) {
return OK;
Expand Down
2 changes: 1 addition & 1 deletion drvIpac/drvIpac.h
Expand Up @@ -202,7 +202,7 @@ typedef struct {
/* Functions for startup and interactive use */

epicsShareFunc int ipacAddCarrier(ipac_carrier_t *pcarrier, const char *cardParams);
epicsShareFunc int ipacReport(int interest);
epicsShareFunc long ipacReport(int interest);
epicsShareFunc int ipacAddNullCarrier (void);
epicsShareFunc int ipacLatestCarrier(void);

Expand Down
2 changes: 1 addition & 1 deletion drvTip810/Makefile
Expand Up @@ -24,7 +24,7 @@ LIBSRCS += devSiWiener.c
LIBSRCS += devBiTip810.c
LIBSRCS += drvTip810.c

USR_CFLAGS += -DUSE_TYPED_RSET
USR_CFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET -DUSE_TYPED_DRVET

LIBRARY_IOC_vxWorks = Tip810
LIBRARY_IOC_RTEMS = Tip810
Expand Down
32 changes: 16 additions & 16 deletions drvTip810/devAiCan.c
Expand Up @@ -85,8 +85,8 @@ typedef struct aiCanBus_s {
int status;
} aiCanBus_t;

static long init_ai(struct aiRecord *prec);
static long get_ioint_info(int cmd, struct aiRecord *prec, IOSCANPVT *ppvt);
static long init_ai(struct dbCommon *prec);
static long get_ioint_info(int cmd, struct dbCommon *prec, IOSCANPVT *ppvt);
static long read_ai(struct aiRecord *prec);
static long special_linconv(struct aiRecord *prec, int after);
static void ProcessCallback(CALLBACK *pcallback);
Expand All @@ -95,19 +95,17 @@ static void busSignal(void *private, int status);
static void busCallback(CALLBACK *pCallback);

struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_ai;
DEVSUPFUN special_linconv;
dset common;
long (*read_ai)(struct aiRecord *prec);
long (*linconv)(struct aiRecord *prec, int after);
} devAiCan = {
6,
NULL,
NULL,
init_ai,
get_ioint_info,
{
6,
NULL,
NULL,
init_ai,
get_ioint_info
},
read_ai,
special_linconv
};
Expand All @@ -117,8 +115,9 @@ static aiCanBus_t *firstBus;


static long init_ai (
struct aiRecord *prec
struct dbCommon *pcommon
) {
struct aiRecord *prec = (struct aiRecord *) pcommon;
aiCanPrivate_t *pcanAi;
aiCanBus_t *pbus;
int status;
Expand Down Expand Up @@ -257,9 +256,10 @@ static long init_ai (

static long get_ioint_info (
int cmd,
struct aiRecord *prec,
struct dbCommon *pcommon,
IOSCANPVT *ppvt
) {
struct aiRecord *prec = (struct aiRecord *) pcommon;
aiCanPrivate_t *pcanAi = prec->dpvt;

if (pcanAi->ioscanpvt == NULL) {
Expand Down
32 changes: 16 additions & 16 deletions drvTip810/devAoCan.c
Expand Up @@ -82,28 +82,26 @@ typedef struct aoCanBus_s {
int status;
} aoCanBus_t;

static long init_ao(struct aoRecord *prec);
static long get_ioint_info(int cmd, struct aoRecord *prec, IOSCANPVT *ppvt);
static long init_ao(struct dbCommon *prec);
static long get_ioint_info(int cmd, struct dbCommon *prec, IOSCANPVT *ppvt);
static long write_ao(struct aoRecord *prec);
static long special_linconv(struct aoRecord *prec, int after);
static void aoMessage(void *private, const canMessage_t *pmessage);
static void busSignal(void *private, int status);
static void busCallback(CALLBACK *pCallback);

struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_ao;
DEVSUPFUN special_linconv;
dset common;
long (*write_ao)(struct aoRecord *prec);
long (*linconv)(struct aoRecord *prec, int after);
} devAoCan = {
6,
NULL,
NULL,
init_ao,
get_ioint_info,
{
6,
NULL,
NULL,
init_ao,
get_ioint_info
},
write_ao,
special_linconv
};
Expand All @@ -113,8 +111,9 @@ static aoCanBus_t *firstBus;


static long init_ao (
struct aoRecord *prec
struct dbCommon *pcommon
) {
struct aoRecord *prec = (struct aoRecord *) pcommon;
aoCanPrivate_t *pcanAo;
aoCanBus_t *pbus;
int status;
Expand Down Expand Up @@ -238,9 +237,10 @@ static long init_ao (

static long get_ioint_info (
int cmd,
struct aoRecord *prec,
struct dbCommon *pcommon,
IOSCANPVT *ppvt
) {
struct aoRecord *prec = (struct aoRecord *) pcommon;
aoCanPrivate_t *pcanAo = prec->dpvt;

if (pcanAo->ioscanpvt == NULL) {
Expand Down
30 changes: 15 additions & 15 deletions drvTip810/devBiCan.c
Expand Up @@ -79,27 +79,25 @@ typedef struct biCanBus_s {
int status;
} biCanBus_t;

static long init_bi(struct biRecord *prec);
static long get_ioint_info(int cmd, struct biRecord *prec, IOSCANPVT *ppvt);
static long init_bi(struct dbCommon *prec);
static long get_ioint_info(int cmd, struct dbCommon *prec, IOSCANPVT *ppvt);
static long read_bi(struct biRecord *prec);
static void ProcessCallback(CALLBACK *pcallback);
static void biMessage(void *private, const canMessage_t *pmessage);
static void busSignal(void *private, int status);
static void busCallback(CALLBACK *pcallback);

struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_bi;
dset common;
long (*read_bi)(struct biRecord *prec);
} devBiCan = {
5,
NULL,
NULL,
init_bi,
get_ioint_info,
{
5,
NULL,
NULL,
init_bi,
get_ioint_info
},
read_bi
};
epicsExportAddress(dset, devBiCan);
Expand All @@ -108,8 +106,9 @@ static biCanBus_t *firstBus;


static long init_bi (
struct biRecord *prec
struct dbCommon *pcommon
) {
struct biRecord *prec = (struct biRecord *) pcommon;
biCanPrivate_t *pcanBi;
biCanBus_t *pbus;
int status;
Expand Down Expand Up @@ -209,9 +208,10 @@ static long init_bi (

static long get_ioint_info (
int cmd,
struct biRecord *prec,
struct dbCommon *pcommon,
IOSCANPVT *ppvt
) {
struct biRecord *prec = (struct biRecord *) pcommon;
biCanPrivate_t *pcanBi = prec->dpvt;

if (pcanBi->ioscanpvt == NULL) {
Expand Down
27 changes: 13 additions & 14 deletions drvTip810/devBiTip810.c
Expand Up @@ -54,28 +54,26 @@ Copyright (c) 1995-2000 Andrew Johnson


/* Create the dset for devBiTip810 */
static long init_bi(struct biRecord *prec);
static long init_bi(struct dbCommon *prec);
static long read_bi(struct biRecord *prec);

struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_bi;
dset common;
long (*read_bi)(struct biRecord *prec);
} devBiTip810 = {
5,
NULL,
NULL,
init_bi,
NULL,
read_bi
{
5,
NULL,
NULL,
init_bi,
NULL
},
read_bi
};
epicsExportAddress(dset, devBiTip810);

static long init_bi(
struct biRecord *prec
struct dbCommon *pcommon
) {
static struct {
char *string;
Expand All @@ -92,6 +90,7 @@ static long init_bi(
{ NULL, 0 }
};

struct biRecord *prec = (struct biRecord *) pcommon;
char *canString;
char *name;
char separator;
Expand Down
30 changes: 15 additions & 15 deletions drvTip810/devBoCan.c
Expand Up @@ -76,26 +76,24 @@ typedef struct boCanBus_s {
int status;
} boCanBus_t;

static long init_bo(struct boRecord *prec);
static long get_ioint_info(int cmd, struct boRecord *prec, IOSCANPVT *ppvt);
static long init_bo(struct dbCommon *prec);
static long get_ioint_info(int cmd, struct dbCommon *prec, IOSCANPVT *ppvt);
static long write_bo(struct boRecord *prec);
static void boMessage(void *private, const canMessage_t *pmessage);
static void busSignal(void *private, int status);
static void busCallback(CALLBACK *pCallback);

struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_bo;
dset common;
long (*write_bo)(struct boRecord *prec);
} devBoCan = {
5,
NULL,
NULL,
init_bo,
get_ioint_info,
{
5,
NULL,
NULL,
init_bo,
get_ioint_info
},
write_bo
};
epicsExportAddress(dset, devBoCan);
Expand All @@ -104,8 +102,9 @@ static boCanBus_t *firstBus;


static long init_bo (
struct boRecord *prec
struct dbCommon *pcommon
) {
struct boRecord *prec = (struct boRecord *) pcommon;
boCanPrivate_t *pcanBo;
boCanBus_t *pbus;
int status;
Expand Down Expand Up @@ -192,9 +191,10 @@ static long init_bo (

static long get_ioint_info (
int cmd,
struct boRecord *prec,
struct dbCommon *pcommon,
IOSCANPVT *ppvt
) {
struct boRecord *prec = (struct boRecord *) pcommon;
boCanPrivate_t *pcanBo = prec->dpvt;

if (pcanBo->ioscanpvt == NULL) {
Expand Down

0 comments on commit a7e0ff4

Please sign in to comment.