forked from epics_driver_modules/motorBase
Make oms58Setup() error messages more prominent.
This commit is contained in:
+41
-12
@@ -2,9 +2,9 @@
|
||||
FILENAME... drvOms58.cc
|
||||
USAGE... Motor record driver level support for OMS model VME58.
|
||||
|
||||
Version: $Revision: 1.27 $
|
||||
Version: $Revision: 1.28 $
|
||||
Modified By: $Author: sluiter $
|
||||
Last Modified: $Date: 2009-02-05 19:25:04 $
|
||||
Last Modified: $Date: 2009-06-18 19:10:49 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -106,6 +106,8 @@ Last Modified: $Date: 2009-02-05 19:25:04 $
|
||||
* epicsInterruptContextMessage calls.
|
||||
* .36 03-14-08 rls - 64-bit compatiability.
|
||||
* .37 02-05-09 rls - Have start_status() start ALL updates before waiting.
|
||||
* .38 06-18-09 rls - Make oms58Setup() error messages more prominent.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -862,14 +864,25 @@ static int recv_mess(int card, char *com, int amount)
|
||||
/* Configuration function for module_types data */
|
||||
/* areas. omsSetup() */
|
||||
/*****************************************************/
|
||||
int oms58Setup(int num_cards, /* maximum number of cards in rack */
|
||||
void *addrs, /* Base Address(0x0-0xb000 on 4K boundary) */
|
||||
unsigned vector, /* noninterrupting(0), valid vectors(64-255) */
|
||||
int int_level, /* interrupt level (1-6) */
|
||||
int scan_rate) /* polling rate - 1/60 sec units */
|
||||
RTN_STATUS
|
||||
oms58Setup(int num_cards, /* maximum number of cards in rack */
|
||||
void *addrs, /* Base Address(0x0-0xb000 on 4K boundary) */
|
||||
unsigned vector, /* noninterrupting(0), valid vectors(64-255) */
|
||||
int int_level, /* interrupt level (1-6) */
|
||||
int scan_rate) /* polling rate - 1-60 Hz */
|
||||
{
|
||||
RTN_STATUS rtncode = OK;
|
||||
char errbase[] = "\noms58Setup: *** invalid ";
|
||||
|
||||
if (num_cards < 1 || num_cards > OMS_NUM_CARDS)
|
||||
{
|
||||
char format[] = "%snumber of cards specified = %d ***\n";
|
||||
oms58_num_cards = OMS_NUM_CARDS;
|
||||
errlogPrintf(format, errbase, num_cards);
|
||||
errlogPrintf(" *** using maximum number = %d ***\n", OMS_NUM_CARDS);
|
||||
epicsThreadSleep(5.0);
|
||||
rtncode = ERROR;
|
||||
}
|
||||
else
|
||||
oms58_num_cards = num_cards;
|
||||
|
||||
@@ -880,8 +893,11 @@ int oms58Setup(int num_cards, /* maximum number of cards in rack */
|
||||
if (addrs > (void *) 0xF000 || ((epicsUInt32) addrs & 0xFFF))
|
||||
#endif
|
||||
{
|
||||
Debug(1, "omsSetup: invalid base address %p\n", addrs);
|
||||
char format[] = "%sbase address = %p ***\n";
|
||||
oms_addrs = (char *) OMS_NUM_ADDRS;
|
||||
errlogPrintf(format, errbase, addrs);
|
||||
epicsThreadSleep(5.0);
|
||||
rtncode = ERROR;
|
||||
}
|
||||
else
|
||||
oms_addrs = (char *) addrs;
|
||||
@@ -891,15 +907,21 @@ int oms58Setup(int num_cards, /* maximum number of cards in rack */
|
||||
{
|
||||
if (vector != 0)
|
||||
{
|
||||
Debug(1, "omsSetup: invalid interrupt vector %d\n", vector);
|
||||
char format[] = "%sinterrupt vector = %d ***\n";
|
||||
omsInterruptVector = (unsigned) OMS_INT_VECTOR;
|
||||
errlogPrintf(format, errbase, vector);
|
||||
epicsThreadSleep(5.0);
|
||||
rtncode = ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (int_level < 1 || int_level > 6)
|
||||
{
|
||||
Debug(1, "omsSetup: invalid interrupt level %d\n", int_level);
|
||||
char format[] = "%sinterrupt level = %d ***\n";
|
||||
omsInterruptLevel = OMS_INT_LEVEL;
|
||||
errlogPrintf(format, errbase, int_level);
|
||||
epicsThreadSleep(5.0);
|
||||
rtncode = ERROR;
|
||||
}
|
||||
else
|
||||
omsInterruptLevel = int_level;
|
||||
@@ -908,8 +930,15 @@ int oms58Setup(int num_cards, /* maximum number of cards in rack */
|
||||
if (scan_rate >= 1 && scan_rate <= 60)
|
||||
targs.motor_scan_rate = scan_rate;
|
||||
else
|
||||
targs.motor_scan_rate = SCAN_RATE;
|
||||
return(0);
|
||||
{
|
||||
char format[] = "%spolling rate = %d Hz ***\n";
|
||||
targs.motor_scan_rate = SCAN_RATE;
|
||||
errlogPrintf(format, errbase, scan_rate);
|
||||
epicsThreadSleep(5.0);
|
||||
rtncode = ERROR;
|
||||
}
|
||||
|
||||
return(rtncode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user