- Renamed tasdrive to ptasdrive in order to help debugging
- Added ritastorage in order to solve storage order problem for RITA's area detector
This commit is contained in:
33
ecbcounter.c
33
ecbcounter.c
@@ -74,6 +74,26 @@ static int readScaler(pECBCounter pPriv, int scaler, int *count){
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int readTime(pECBCounter pPriv,float *time){
|
||||
int status;
|
||||
Z80_reg in, out;
|
||||
Ecb_pack data;
|
||||
|
||||
in.c = (unsigned char)0;
|
||||
status = ecbExecute(pPriv->ecb,STREAD,in,&out);
|
||||
if(status != 1){
|
||||
return COMMERROR;
|
||||
}
|
||||
|
||||
data.b.byt3 = out.c;
|
||||
data.b.byt2 = out.b;
|
||||
data.b.byt1 = out.d;
|
||||
data.b.byt0 = out.e;
|
||||
*time = (float)data.result/(float)pPriv->tfreq;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
static int check4Beam(struct __COUNTER *pCter, int *beam){
|
||||
Z80_reg in, out;
|
||||
@@ -147,6 +167,7 @@ static int ECBGetStatus(struct __COUNTER *self, float *fControl){
|
||||
int status, result, scaler;
|
||||
Z80_reg in, out;
|
||||
int count, beam;
|
||||
float time;
|
||||
|
||||
assert(pPriv);
|
||||
|
||||
@@ -210,16 +231,13 @@ static int ECBGetStatus(struct __COUNTER *self, float *fControl){
|
||||
*/
|
||||
if(self->eMode == eTimer){
|
||||
scaler = 0;
|
||||
readTime(pPriv,fControl);
|
||||
}else {
|
||||
scaler = pPriv->control;
|
||||
readScaler(pPriv,scaler,&count);
|
||||
*fControl = (float)count;
|
||||
}
|
||||
|
||||
readScaler(pPriv,scaler,&count);
|
||||
/*
|
||||
ignore errors on this one
|
||||
*/
|
||||
*fControl = (float)count;
|
||||
|
||||
return result;
|
||||
}
|
||||
/*=====================================================================*/
|
||||
@@ -361,12 +379,11 @@ static int ECBTransfer(struct __COUNTER *self){
|
||||
/*
|
||||
read time
|
||||
*/
|
||||
status = readScaler(pPriv,0,&count);
|
||||
status = readTime(pPriv,&self->fTime);
|
||||
if(status <= 0){
|
||||
self->iErrorCode = COMMERROR;
|
||||
return HWFault;
|
||||
}
|
||||
self->fTime = (float)count;
|
||||
|
||||
/*
|
||||
read other scalers
|
||||
|
||||
Reference in New Issue
Block a user