mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
status register updates
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@129 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -1329,7 +1329,8 @@ u_int32_t stopStateMachine(){
|
|||||||
#endif
|
#endif
|
||||||
bus_w(CONTROL_REG, STOP_ACQ_BIT);
|
bus_w(CONTROL_REG, STOP_ACQ_BIT);
|
||||||
usleep(500);
|
usleep(500);
|
||||||
if (!runBusy())
|
// if (!runBusy())
|
||||||
|
if(!(bus_r(STATUS_REG)&RUNMACHINE_BUSY_BIT))
|
||||||
return OK;
|
return OK;
|
||||||
else
|
else
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
@ -148,8 +148,19 @@
|
|||||||
#define DELAYAFTER_BIT 0x00000020
|
#define DELAYAFTER_BIT 0x00000020
|
||||||
#define EXPOSING_BIT 0x00000040
|
#define EXPOSING_BIT 0x00000040
|
||||||
#define COUNT_ENABLE_BIT 0x00000080
|
#define COUNT_ENABLE_BIT 0x00000080
|
||||||
|
#define RUNSTATE_0_BIT 0x00000100
|
||||||
|
#define RUNSTATE_1_BIT 0x00000200
|
||||||
|
#define RUNSTATE_2_BIT 0x00000400
|
||||||
|
|
||||||
|
#define READSTATE_0_BIT 0x00001000
|
||||||
|
#define READSTATE_1_BIT 0x00002000
|
||||||
|
#define READSTATE_2_BIT 0x00004000
|
||||||
#define SOME_FIFO_FULL_BIT 0x00008000 // error!
|
#define SOME_FIFO_FULL_BIT 0x00008000 // error!
|
||||||
#define ALL_FIFO_EMPTY_BIT 0x00010000 // data ready
|
#define ALL_FIFO_EMPTY_BIT 0x00010000 // data ready
|
||||||
|
#define RUNMACHINE_BUSY_BIT 0x00020000
|
||||||
|
#define READMACHINE_BUSY_BIT 0x00040000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* for fifo status register */
|
/* for fifo status register */
|
||||||
#define FIFO_ENABLED_BIT 0x80000000
|
#define FIFO_ENABLED_BIT 0x80000000
|
||||||
|
@ -1842,32 +1842,53 @@ int get_run_status(int file_des) {
|
|||||||
retval= runState();
|
retval= runState();
|
||||||
printf("\n\nSTATUS=%08x\n",retval);
|
printf("\n\nSTATUS=%08x\n",retval);
|
||||||
|
|
||||||
if (retval&0x00000001){
|
//if runbusy=0
|
||||||
printf("-----------------------------------RUNNING-----------------------------------\n");
|
if(!(retval&0x00020000)){
|
||||||
s=RUNNING;
|
//and readbusy=1, its last frame read
|
||||||
|
if(retval&0x00040000){
|
||||||
|
printf("-----------------------------------LAST FRAME READ--------------------------\n");
|
||||||
|
s=TRANSMITTING;
|
||||||
|
}
|
||||||
|
//and readbusy=0,idle
|
||||||
|
if(!(retval&0x00000001)){
|
||||||
|
printf("-----------------------------------IDLE--------------------------------------\n");
|
||||||
|
s=IDLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
//if runbusy=1
|
||||||
printf("-----------------------------------IDLE----------------------------------\n");
|
else {
|
||||||
s=IDLE;
|
if (retval&0x00000008){
|
||||||
|
printf("-----------------------------------WAITING-----------------------------------\n");
|
||||||
|
s=WAITING;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
printf("-----------------------------------RUNNING-----------------------------------\n");
|
||||||
|
s=RUNNING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
if (retval&0x8000)
|
if (retval&0x8000)
|
||||||
s=ERROR;
|
s=ERROR;
|
||||||
else if (retval&0x00000001)
|
else if (retval&0x00000001)
|
||||||
//if (retval&0x00010000)
|
//if (retval&0x00010000)
|
||||||
if (retval&0x00000002)
|
if (retval&0x00000002)
|
||||||
s=TRANSMITTING;
|
s=TRANSMITTING;
|
||||||
else
|
else
|
||||||
s=RUNNING;
|
s=RUNNING;
|
||||||
else if (retval&0x00010000)
|
else if (retval&0x00010000)
|
||||||
s=RUN_FINISHED;
|
s=RUN_FINISHED;
|
||||||
else if (retval&0x00000008)
|
else if (retval&0x00000008)
|
||||||
s=WAITING;
|
s=WAITING;
|
||||||
else
|
else
|
||||||
s=IDLE;
|
s=IDLE;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (ret!=OK) {
|
if (ret!=OK) {
|
||||||
printf("get status failed\n");
|
printf("get status failed\n");
|
||||||
} else if (differentClients)
|
} else if (differentClients)
|
||||||
|
Reference in New Issue
Block a user