added the code for toggle bit to know when acquisition started in febcontrol and list, indentation as well

This commit is contained in:
Dhanya Maliakal
2015-05-20 12:01:49 +02:00
parent 1f1581a1fa
commit 302d9ca0ed
6 changed files with 809 additions and 797 deletions

View File

@ -101,7 +101,7 @@
#define DAQ_STATUS_TOKEN_OUT 0x20 #define DAQ_STATUS_TOKEN_OUT 0x20
#define DAQ_STATUS_SERIAL_OUT 0x40 #define DAQ_STATUS_SERIAL_OUT 0x40
#define DAQ_STATUS_PIXELS_ARE_ENABLED 0x80 #define DAQ_STATUS_PIXELS_ARE_ENABLED 0x80
#define DAQ_STATUS_DAQ_RUN_TOGGLE 0x200
//data delay registers //data delay registers
#define CHIP_DATA_OUT_DELAY_REG_CTRL 1 #define CHIP_DATA_OUT_DELAY_REG_CTRL 1

File diff suppressed because it is too large Load Diff

View File

@ -149,8 +149,10 @@ int Feb_Control_GetModuleNumber();
int Feb_Control_StartAcquisition(); int Feb_Control_StartAcquisition();
int Feb_Control_StopAcquisition(); int Feb_Control_StopAcquisition();
int Feb_Control_AcquisitionInProgress(); int Feb_Control_AcquisitionInProgress();
int Feb_Control_AcquisitionStartedBit();
/*int Feb_Control_WaitForFinishedFlag(int sleep_time_us=5000);*/ /*int Feb_Control_WaitForFinishedFlag(int sleep_time_us=5000);*/
int Feb_Control_WaitForFinishedFlag(int sleep_time_us); int Feb_Control_WaitForFinishedFlag(int sleep_time_us);
int Feb_Control_WaitForStartedFlag(int sleep_time_us, int prev_flag);
//functions for setting up exposure //functions for setting up exposure
void Feb_Control_PrintAcquisitionSetup(); void Feb_Control_PrintAcquisitionSetup();

View File

@ -101,7 +101,7 @@
#define DAQ_STATUS_TOKEN_OUT 0x20 #define DAQ_STATUS_TOKEN_OUT 0x20
#define DAQ_STATUS_SERIAL_OUT 0x40 #define DAQ_STATUS_SERIAL_OUT 0x40
#define DAQ_STATUS_PIXELS_ARE_ENABLED 0x80 #define DAQ_STATUS_PIXELS_ARE_ENABLED 0x80
#define DAQ_STATUS_DAQ_RUN_TOGGLE 0x200
//data delay registers //data delay registers
#define CHIP_DATA_OUT_DELAY_REG_CTRL 1 #define CHIP_DATA_OUT_DELAY_REG_CTRL 1

View File

@ -502,58 +502,34 @@ int startReceiver(int d){
int startStateMachine(){ int startStateMachine(){
int ret; int ret,prev_flag;
//if(master){ //get the DAQ toggle bit
printf("Going to start acquisition\n"); prev_flag = Feb_Control_AcquisitionStartedBit();
Feb_Control_StartAcquisition();
//}
//do not read status here, cannot get images then printf("Going to start acquisition\n");
Feb_Control_StartAcquisition();
////if(trialMasterMode == IS_MASTER){
printf("requesting images\n"); printf("requesting images\n");
ret = startReadOut(); ret = startReadOut();
////}
//if(trialMasterMode == IS_MASTER){
//wait for acquisition start
//if(master){ if(ret == OK){
/* if(!Feb_Control_WaitForStartedFlag(5000, prev_flag)){
* int i=0; cprintf(RED,"Error: Acquisition did no start or trouble reading register\n");
if(getRunStatus() == IDLE){ ret = FAIL;
for(i=0;i<100000;i++){
usleep(1000);
if(getRunStatus() != IDLE){
printf("*****i=%d\n",i);
break;
}
}
//while(getRunStatus() == IDLE);
//}
printf("*****Acquiring...\n");
}
*/
while(getRunStatus() == IDLE){
printf("waiting for being not idle anymore\n");
} }
printf("*****Acquiring...\n"); cprintf(GREEN,"***Acquisition started\n");
//} }
/*else usleep(1000000); /*while(getRunStatus() == IDLE){printf("waiting for being not idle anymore\n");}*/
printf("****Returning\n");*/
return ret; return ret;
} }
int stopStateMachine(){ int stopStateMachine(){
//if(trialMasterMode == IS_MASTER){
printf("Going to stop acquisition\n"); printf("Going to stop acquisition\n");
if(Feb_Control_StopAcquisition()) if(Feb_Control_StopAcquisition())
return OK; return OK;
//}else return OK;
return FAIL; return FAIL;
} }
@ -600,8 +576,8 @@ enum runStatus getRunStatus(){
char *readFrame(int *ret, char *mess){ char *readFrame(int *ret, char *mess){
//if(master){ //if(master){
if(!Feb_Control_WaitForFinishedFlag(5000)) if(!Feb_Control_WaitForFinishedFlag(5000))
printf("error in waiting for finished flag\n"); cprintf(RED,"Error: Waiting for finished flag\n");
printf("Acquisition finished\n"); cprintf(GREEN,"Acquisition finished***\n");
//usleep(0); //usleep(0);
usleep(1000000); usleep(1000000);
printf("*****Done Waiting...\n"); printf("*****Done Waiting...\n");