- Refactored histogram memory code a little
- motor driver for ECB now fully working - Fixed an anticollider bug - Untested version of a driver for the Risoe TDC histogram memory
This commit is contained in:
12
ecbdriv.c
12
ecbdriv.c
@@ -67,8 +67,9 @@ Parameter indexes in ObPar array and meanings
|
||||
#define STEPS2DEG 13 /* conversion factor motor steps to Degree */
|
||||
#define DEG2STEP 14 /* conversion factor from degree to encoder digits */
|
||||
#define BACKLASH 15 /* motor backlash */
|
||||
#define PORT 17 /* ECB port when multiplexed */
|
||||
|
||||
#define MAXPAR 18 /* 1 extra for the sentinel, do not forget to initialize! */
|
||||
#define MAXPAR 19 /* 1 extra for the sentinel, do not forget to initialize! */
|
||||
|
||||
/*------------------------------ ECB defines -------------------------*/
|
||||
#define MAX_ENCODER 40
|
||||
@@ -411,7 +412,8 @@ static int loadMulti(pECBMotDriv self){
|
||||
mult_chan = (unsigned char)rint(ObVal(self->driverPar,MULTCHAN));
|
||||
in.b = -1; /* SET_PORT */
|
||||
in.d = (unsigned char)(multi + (mult_chan << 4));
|
||||
in.e = self->ecbIndex;
|
||||
in.e = (unsigned char)rint(ObVal(self->driverPar,PORT));
|
||||
in.c = self->ecbIndex;
|
||||
status = ecbExecute(self->ecb,MOPARA,in,&out);
|
||||
if(status != 1){
|
||||
self->errorCode = COMMERROR;
|
||||
@@ -557,7 +559,7 @@ static int controlMotor(pECBMotDriv self, int enable){
|
||||
*/
|
||||
in.e = 8;
|
||||
in.b = 11; /* set control signal */
|
||||
in.c = -self->ecbIndex;
|
||||
in.c = self->ecbIndex;
|
||||
status = ecbExecute(self->ecb,MOPARA,in,&out);
|
||||
if(status != 1){
|
||||
self->errorCode = COMMERROR;
|
||||
@@ -698,9 +700,6 @@ static int checkStatusResponse(pECBMotDriv self, Z80_reg out){
|
||||
return HWFault;
|
||||
} else if(out.b & 32){
|
||||
return HWBusy;
|
||||
} else if(out.b & 64){
|
||||
self->errorCode = ECBINHIBIT;
|
||||
return HWFault;
|
||||
} else if(out.b & 16){
|
||||
self->errorCode = ECBLIMIT;
|
||||
return HWFault;
|
||||
@@ -1142,6 +1141,7 @@ static void initializeParameters(pECBMotDriv self){
|
||||
ObParInit(self->driverPar,STEPS2DEG,"step2deg",1,usMugger);
|
||||
ObParInit(self->driverPar,DEG2STEP,"step2dig",0,usMugger);
|
||||
ObParInit(self->driverPar,BACKLASH,"backlash",0,usMugger);
|
||||
ObParInit(self->driverPar,PORT,"port",0,usMugger);
|
||||
ObParInit(self->driverPar,MAXPAR-1,"tueet",-100,-100); /* sentinel! */
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user