forked from epics_driver_modules/motorBase
Added board reboot error check.
This commit is contained in:
@@ -109,6 +109,9 @@ HeadURL: $URL$
|
||||
* .37 02-05-09 rls - Have start_status() start ALL updates before waiting.
|
||||
* .38 06-18-09 rls - Make oms58Setup() error messages more prominent.
|
||||
* .39 03-15-10 rls - sprintf() not callable from any OS ISR.
|
||||
* .40 01-26-11 rls - added reboot flag to DPRAM R/W reserved area. Driver
|
||||
* sets flag to 0x4321; set_status() disables board if flag
|
||||
* does not read 0x4321.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -226,6 +229,8 @@ struct drvOms58_drvet
|
||||
|
||||
extern "C" {epicsExportAddress(drvet, drvOms58);}
|
||||
|
||||
static char rebootmsg[] = "\n***VME58 card #%d Disabled*** Reboot Detected.\n\n";
|
||||
|
||||
static struct thread_args targs = {SCAN_RATE, &oms58_access, 0.000};
|
||||
|
||||
/*----------------functions-----------------*/
|
||||
@@ -416,6 +421,17 @@ static int set_status(int card, int signal)
|
||||
pmotor = (struct vmex_motor *) motor_state[card]->localaddr;
|
||||
status.All = motor_info->status.All;
|
||||
|
||||
if (pmotor->rebootind != 0x4321) /* Test if board has rebooted. */
|
||||
{
|
||||
errlogPrintf(rebootmsg, card);
|
||||
status.Bits.RA_PROBLEM = 1;
|
||||
motor_info->status.All = status.All;
|
||||
send_mess(card, STOP_ALL, (char) NULL);
|
||||
/* Disable board. */
|
||||
motor_state[card] = (struct controller *) NULL;
|
||||
return(rtn_state = 1); /* End move. */
|
||||
}
|
||||
|
||||
if (motor_info->encoder_present == YES)
|
||||
{
|
||||
/* get 4 peices of info from axis */
|
||||
@@ -1217,6 +1233,8 @@ static int motor_init()
|
||||
errPrintf(0, __FILE__, __LINE__, "Interrupts Disabled!\n");
|
||||
}
|
||||
|
||||
pmotor->rebootind = 0x4321; /* Set reboot indicator. */
|
||||
|
||||
start_status(card_index);
|
||||
for (motor_index = 0; motor_index < total_axis; motor_index++)
|
||||
{
|
||||
|
||||
+15
-11
@@ -6,6 +6,7 @@ USAGE... OMS driver level "include" information that is specific to OMS
|
||||
Version: $Revision$
|
||||
Modified By: $Author$
|
||||
Last Modified: $Date$
|
||||
HeadURL: $URL$
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -46,6 +47,7 @@ Last Modified: $Date$
|
||||
* .09 05-09-97 jps increase maximum card count to 15
|
||||
* .10 08-22-01 rls "int" type specifications for all bit-fields.
|
||||
* .11 03-21-05 rls replace VxWorks specific "uint16_t" with "epicsUInt16".
|
||||
* .12 01-26-11 rls added reboot flag in DPRAM R/W reserved area.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -247,17 +249,19 @@ typedef struct
|
||||
|
||||
/* OMS VME dual port memory map */
|
||||
struct vmex_motor
|
||||
{
|
||||
epicsInt16 inPutIndex;
|
||||
epicsInt16 outGetIndex;
|
||||
epicsInt16 inBuffer[BUFFER_SIZE];
|
||||
epicsInt16 reserved0[254];
|
||||
MOTOR_DATA_REGS data[OMS_NUM_CHANNELS];
|
||||
epicsInt16 outPutIndex;
|
||||
epicsInt16 inGetIndex;
|
||||
epicsInt16 outBuffer[BUFFER_SIZE];
|
||||
epicsInt16 reserved1[750];
|
||||
MOTOR_CNTRL_REGS control;
|
||||
{ /* Offset */
|
||||
epicsInt16 inPutIndex; /* 0x0000 */
|
||||
epicsInt16 outGetIndex; /* 0x0002 */
|
||||
epicsInt16 inBuffer[BUFFER_SIZE]; /* 0x0004 */
|
||||
epicsInt16 reserved0[254]; /* 0x0204 */
|
||||
MOTOR_DATA_REGS data[OMS_NUM_CHANNELS]; /* 0x0400 */
|
||||
epicsInt16 outPutIndex; /* 0x0800 */
|
||||
epicsInt16 inGetIndex; /* 0x0802 */
|
||||
epicsInt16 outBuffer[BUFFER_SIZE]; /* 0x0804 */
|
||||
epicsInt16 rebootind; /* 0x0A04 - used by driver to
|
||||
* test for board reboot. */
|
||||
epicsInt16 reserved1[749]; /* 0x0A06 */
|
||||
MOTOR_CNTRL_REGS control; /* 0x0FE0 */
|
||||
};
|
||||
|
||||
#endif /* INCdrvOms58h */
|
||||
|
||||
Reference in New Issue
Block a user