From 4125a39c4026f4729c70e0700e78c5d01a16d034 Mon Sep 17 00:00:00 2001 From: Keenan Lang Date: Wed, 3 May 2017 10:15:20 -0500 Subject: [PATCH] Add iocsh bindings for oms58Setup command --- motorApp/OmsSrc/devOms.dbd | 1 + motorApp/OmsSrc/drvOms58.cc | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/motorApp/OmsSrc/devOms.dbd b/motorApp/OmsSrc/devOms.dbd index d0b4f55e..569232b4 100644 --- a/motorApp/OmsSrc/devOms.dbd +++ b/motorApp/OmsSrc/devOms.dbd @@ -5,6 +5,7 @@ driver(drvOms) # Oregon Micro Systems VME58 driver support. device(motor,VME_IO,devOms58,"OMS VME58") driver(drvOms58) +registrar(oms58Registrar) # Oregon Micro Systems MAXv driver support. device(motor,VME_IO,devMAXv,"OMS MAXv") diff --git a/motorApp/OmsSrc/drvOms58.cc b/motorApp/OmsSrc/drvOms58.cc index 2643ef61..38511374 100644 --- a/motorApp/OmsSrc/drvOms58.cc +++ b/motorApp/OmsSrc/drvOms58.cc @@ -141,6 +141,7 @@ USAGE... Motor record driver level support for OMS model VME58. #include "drvOms58.h" #include "epicsExport.h" +#include "iocsh.h" #define PRIVATE_FUNCTIONS 1 /* normal:1, debug:0 */ @@ -1357,4 +1358,28 @@ static void oms_reset(void *arg) } +/* Epics iocsh bindings */ + +static const iocshArg oms58Arg0 = {"num_card", iocshArgInt}; +static const iocshArg oms58Arg1 = {"addrs", iocshArgInt}; +static const iocshArg oms58Arg2 = {"vector", iocshArgInt}; +static const iocshArg oms58Arg3 = {"int_level", iocshArgInt}; +static const iocshArg oms58Arg4 = {"scan_rate", iocshArgInt}; + +static const iocshArg* const oms58Args[5] = {&oms58Arg0, &oms58Arg1, &oms58Arg2, &oms58Arg3, &oms58Arg4}; + +static const iocshFuncDef oms58FuncDef = {"oms58Setup", 5, oms58Args}; + +static void oms58CallFunc(const iocshArgBuf* args) +{ + oms58Setup(args[0].ival, (void*) args[1].ival, (unsigned) args[2].ival, args[3].ival, args[4].ival); +} + +void oms58Registrar(void) +{ + iocshRegister(&oms58FuncDef, &oms58CallFunc); +} + +epicsExportRegistrar(oms58Registrar); + /*---------------------------------------------------------------------*/