mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +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:
parent
4a4e7540ca
commit
bd54f179ed
@ -1329,7 +1329,8 @@ u_int32_t stopStateMachine(){
|
||||
#endif
|
||||
bus_w(CONTROL_REG, STOP_ACQ_BIT);
|
||||
usleep(500);
|
||||
if (!runBusy())
|
||||
// if (!runBusy())
|
||||
if(!(bus_r(STATUS_REG)&RUNMACHINE_BUSY_BIT))
|
||||
return OK;
|
||||
else
|
||||
return FAIL;
|
||||
|
@ -148,8 +148,19 @@
|
||||
#define DELAYAFTER_BIT 0x00000020
|
||||
#define EXPOSING_BIT 0x00000040
|
||||
#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 ALL_FIFO_EMPTY_BIT 0x00010000 // data ready
|
||||
#define RUNMACHINE_BUSY_BIT 0x00020000
|
||||
#define READMACHINE_BUSY_BIT 0x00040000
|
||||
|
||||
|
||||
|
||||
/* for fifo status register */
|
||||
#define FIFO_ENABLED_BIT 0x80000000
|
||||
|
@ -1842,32 +1842,53 @@ int get_run_status(int file_des) {
|
||||
retval= runState();
|
||||
printf("\n\nSTATUS=%08x\n",retval);
|
||||
|
||||
if (retval&0x00000001){
|
||||
printf("-----------------------------------RUNNING-----------------------------------\n");
|
||||
s=RUNNING;
|
||||
//if runbusy=0
|
||||
if(!(retval&0x00020000)){
|
||||
//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{
|
||||
printf("-----------------------------------IDLE----------------------------------\n");
|
||||
s=IDLE;
|
||||
//if runbusy=1
|
||||
else {
|
||||
if (retval&0x00000008){
|
||||
printf("-----------------------------------WAITING-----------------------------------\n");
|
||||
s=WAITING;
|
||||
}
|
||||
else{
|
||||
printf("-----------------------------------RUNNING-----------------------------------\n");
|
||||
s=RUNNING;
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if (retval&0x8000)
|
||||
s=ERROR;
|
||||
s=ERROR;
|
||||
else if (retval&0x00000001)
|
||||
//if (retval&0x00010000)
|
||||
if (retval&0x00000002)
|
||||
s=TRANSMITTING;
|
||||
else
|
||||
s=RUNNING;
|
||||
//if (retval&0x00010000)
|
||||
if (retval&0x00000002)
|
||||
s=TRANSMITTING;
|
||||
else
|
||||
s=RUNNING;
|
||||
else if (retval&0x00010000)
|
||||
s=RUN_FINISHED;
|
||||
s=RUN_FINISHED;
|
||||
else if (retval&0x00000008)
|
||||
s=WAITING;
|
||||
s=WAITING;
|
||||
else
|
||||
s=IDLE;
|
||||
s=IDLE;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
if (ret!=OK) {
|
||||
printf("get status failed\n");
|
||||
} else if (differentClients)
|
||||
|
Loading…
x
Reference in New Issue
Block a user