- Fixed putpos bug in ecbdriv.c
- Improved handling of conflicting drive commands in ecbdriv.c - Better status codes after drive command - Better error handling in anticollider
This commit is contained in:
63
ecbdriv.c
63
ecbdriv.c
@ -240,6 +240,7 @@ static int checkMotorResult(pECBMotDriv self, Z80_reg out){
|
||||
self->errorCode = ECBINHIBIT;
|
||||
break;
|
||||
case 32:
|
||||
case 96:
|
||||
self->errorCode = ECBRUNNING;
|
||||
break;
|
||||
case 1:
|
||||
@ -252,6 +253,7 @@ static int checkMotorResult(pECBMotDriv self, Z80_reg out){
|
||||
self->errorCode = ECBINUSE;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"Unidentified ECB motor error code %d\n", out.b);
|
||||
self->errorCode = UNIDENTIFIED;
|
||||
break;
|
||||
}
|
||||
@ -846,30 +848,6 @@ static void ECBGetError(void *pData, int *iCode, char *buffer, int bufferlen){
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*=======================================================================*/
|
||||
static int ECBTryAndFixIt(void *pData, int iCode, float fNew){
|
||||
pECBMotDriv self = (pECBMotDriv)pData;
|
||||
int result;
|
||||
Z80_reg in, out;
|
||||
|
||||
assert(self);
|
||||
|
||||
switch(iCode){
|
||||
case ECBMANUELL:
|
||||
in.d = 1 ;
|
||||
ecbExecute(self->ecb,162,in,&out);
|
||||
result = MOTREDO;
|
||||
break;
|
||||
case COMMERROR:
|
||||
ecbClear(self->ecb);
|
||||
result = MOTREDO;
|
||||
break;
|
||||
default:
|
||||
result = MOTFAIL;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/*========================================================================*/
|
||||
static int ECBHalt(void *pData){
|
||||
pECBMotDriv self = (pECBMotDriv)pData;
|
||||
@ -890,6 +868,42 @@ static int ECBHalt(void *pData){
|
||||
return 1;
|
||||
}
|
||||
/*=======================================================================*/
|
||||
static int ECBTryAndFixIt(void *pData, int iCode, float fNew){
|
||||
pECBMotDriv self = (pECBMotDriv)pData;
|
||||
int result;
|
||||
Z80_reg in, out;
|
||||
int i;
|
||||
|
||||
assert(self);
|
||||
|
||||
switch(iCode){
|
||||
case ECBMANUELL:
|
||||
in.d = 1 ;
|
||||
ecbExecute(self->ecb,162,in,&out);
|
||||
result = MOTREDO;
|
||||
break;
|
||||
case ECBRUNNING:
|
||||
ECBHalt(pData);
|
||||
self->restart = 0;
|
||||
for(i = 0; i < 7; i++){
|
||||
if(ECBGetStatus(pData) == HWIdle){
|
||||
break;
|
||||
}
|
||||
SicsWait(1);
|
||||
}
|
||||
result = MOTREDO;
|
||||
break;
|
||||
case COMMERROR:
|
||||
ecbClear(self->ecb);
|
||||
result = MOTREDO;
|
||||
break;
|
||||
default:
|
||||
result = MOTFAIL;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/*=======================================================================*/
|
||||
static int ECBGetDriverPar(void *pData,char *name, float *value){
|
||||
pECBMotDriv self = (pECBMotDriv)pData;
|
||||
ObPar *par = NULL;
|
||||
@ -1019,6 +1033,7 @@ static int ECBSetDriverPar(void *pData, SConnection *pCon, char *name,
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return status;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
include ../$(SRC)linux_def
|
||||
|
||||
HDFROOT=/usr/users/SANS2/src
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -I$(SRC)hardsup \
|
||||
-I../$(SRC) -fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY)
|
||||
|
@ -5,11 +5,14 @@
|
||||
# Markus Zolliker, March 2003
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
include ../../$(SRC)linux_def
|
||||
include ../../linux_def
|
||||
|
||||
SICST=..
|
||||
SICS=$(SRC)..
|
||||
|
||||
CC = gcc
|
||||
FC = g77
|
||||
CFLAGS = -DLINUX -g $(DFORTIFY)
|
||||
CFLAGS = -DLINUX -g $(DFORTIFY) -I../..
|
||||
FFLAGS = -u -fvxt -g
|
||||
ARFLAGS = cr
|
||||
|
||||
@ -20,6 +23,9 @@ ARFLAGS = cr
|
||||
PGPLOT =/afs/psi.ch/user/z/zolliker/pgplot/
|
||||
PGLIB =$(PGPLOT)/libpgplot.a -L/usr/X11R6/lib -lX11
|
||||
|
||||
# -- library for ASYNSRV
|
||||
HARDSUPLIB=../hardsup/libhlib.a
|
||||
|
||||
# -- readline library
|
||||
RDLIB =-lreadline -ltermcap
|
||||
|
||||
|
Reference in New Issue
Block a user