// int fpga_addr= (frame16 <0) ? X313_I2C_ASAP : (X313_I2C_FRAME0+frame16);
// int fpga_addr= (frame16 <0) ? X313_I2C_ASAP : (X313_I2C_FRAME0+frame16);
intfpga_addr=frame16<0;
// int fpga_addr= frame16 <0;
// int fpga_addr359= (frame16 <0) ? X313_I2C_ASAP : (X313_I2C_FRAME0+((frame16 + ((GLOBALPARS(G_MULTI_CFG)>>G_MULTI_CFG_DLYI2C) & 1)) & PARS_FRAMES_MASK)); // will point to one i2c frame later than fpga_addr
// int fpga_addr359= (frame16 <0) ? X313_I2C_ASAP : (X313_I2C_FRAME0+((frame16 + ((GLOBALPARS(G_MULTI_CFG)>>G_MULTI_CFG_DLYI2C) & 1)) & PARS_FRAMES_MASK)); // will point to one i2c frame later than fpga_addr
intfpga_addr359=frame16+((GLOBALPARS(sensor_port,G_MULTI_CFG)>>G_MULTI_CFG_DLYI2C)&1);// will point to one i2c frame later than fpga_addr
intfpga_addr359=frame16+((GLOBALPARS(sensor_port,G_MULTI_CFG)>>G_MULTI_CFG_DLYI2C)&1);// will point to one i2c frame later than fpga_addr
@@ -481,6 +478,12 @@ int multisensor_pgm_window_common (int sensor_port, ///< sensor p
...
@@ -481,6 +478,12 @@ int multisensor_pgm_window_common (int sensor_port, ///< sensor p
intcomposite=(thispars->pars[P_MULTI_MODE])?1:0;
intcomposite=(thispars->pars[P_MULTI_MODE])?1:0;
intasync=(thispars->pars[P_TRIG]&4)?1:0;
intasync=(thispars->pars[P_TRIG]&4)?1:0;
intselected=thispars->pars[P_MULTI_SELECTED];// 1..3 - selected in single frame mode
intselected=thispars->pars[P_MULTI_SELECTED];// 1..3 - selected in single frame mode
intsequence;
intactive;// sensors to program
intstyp;
intmulti_mode_flips;
if(frame16>=PARS_FRAMES)return-1;// wrong frame
dev_dbg(g_dev_ptr,"frame16=%d\n",frame16);
if(composite&&(!async)){
if(composite&&(!async)){
printk("*** ERROR (Should be disabled in multisensor_pgm_multisens() ) CANNOT USE COMPOSITE MODE WITH FREE RUNNING SENSOR ***\n");
printk("*** ERROR (Should be disabled in multisensor_pgm_multisens() ) CANNOT USE COMPOSITE MODE WITH FREE RUNNING SENSOR ***\n");
...
@@ -488,8 +491,8 @@ int multisensor_pgm_window_common (int sensor_port, ///< sensor p
...
@@ -488,8 +491,8 @@ int multisensor_pgm_window_common (int sensor_port, ///< sensor p
SETFRAMEPARS_SET(P_MULTI_MODE,0);// Do we need to force anything here? If it was async->free transition? Or just TRIG mode should have all the dependencies of P_MULTI_MODE
SETFRAMEPARS_SET(P_MULTI_MODE,0);// Do we need to force anything here? If it was async->free transition? Or just TRIG mode should have all the dependencies of P_MULTI_MODE
}
}
intsequence=thispars->pars[P_MULTI_SEQUENCE];
sequence=thispars->pars[P_MULTI_SEQUENCE];
intactive=0;// sensors to program
active=0;// sensors to program
// int sensor_mask=(thispars->pars[P_MULTISENS_EN]) & GLOBALPARS(G_SENS_AVAIL); // sensor mask should already be applied to sequence in afterinit
// int sensor_mask=(thispars->pars[P_MULTISENS_EN]) & GLOBALPARS(G_SENS_AVAIL); // sensor mask should already be applied to sequence in afterinit
flip=((thispars->pars[P_FLIPH]&1)|((thispars->pars[P_FLIPV]&1)<<1))^sensor->init_flips;// 10338 is _not_ flipped (as the ther boards, but for legacy compatibility....)
flip=((thispars->pars[P_FLIPH]&1)|((thispars->pars[P_FLIPV]&1)<<1))^sensor->init_flips;// 10338 is _not_ flipped (as the ther boards, but for legacy compatibility....)
flipX=flip&1;
flipX=flip&1;
...
@@ -501,7 +504,7 @@ int multisensor_pgm_window_common (int sensor_port, ///< sensor p
...
@@ -501,7 +504,7 @@ int multisensor_pgm_window_common (int sensor_port, ///< sensor p
if(!sensor_mask)sensor_mask=GLOBALPARS(sensor_port,G_SENS_AVAIL);// if none sensors were enabled - enable all what is available (same as with WOI size)
// handling P_MULTI_SEQUENCE
// handling P_MULTI_SEQUENCE
intsequence=thispars->pars[P_MULTI_SEQUENCE];
intsequence=thispars->pars[P_MULTI_SEQUENCE];
// int prev_sequence= prevpars->pars[P_MULTI_SEQUENCE];
if(!sensor_mask)sensor_mask=GLOBALPARS(sensor_port,G_SENS_AVAIL);// if none sensors were enabled - enable all what is available (same as with WOI size)
if(composite&&(!async)){
if(composite&&(!async)){
printk("*** CANNOT USE COMPOSITE MODE WITH FREE RUNNING SENSOR ***\n");
printk("*** CANNOT USE COMPOSITE MODE WITH FREE RUNNING SENSOR ***\n");
composite=0;
composite=0;
...
@@ -1249,10 +1269,10 @@ int multisensor_pgm_multisens (int sensor_port, ///< sensor port n
...
@@ -1249,10 +1269,10 @@ int multisensor_pgm_multisens (int sensor_port, ///< sensor port n
SETFRAMEPARS_COND(P_MULTI_SEQUENCE,sequence);
SETFRAMEPARS_COND(P_MULTI_SEQUENCE,sequence);
SETFRAMEPARS_COND(P_MULTISENS_EN,sensor_mask);
SETFRAMEPARS_COND(P_MULTISENS_EN,sensor_mask);
memcpy(wois,&(thispars->pars[P_MULTI_WOI]),sizeof(wois));// copy WOI parameters for 3 sensors
memcpy(wois,&(thispars->pars[P_MULTI_WOI]),sizeof(wois));// copy WOI parameters for 3 sensors
intmulti_fliph=thispars->pars[P_MULTI_FLIPH];
// int multi_fliph=thispars->pars[P_MULTI_FLIPH];
intmulti_flipv=thispars->pars[P_MULTI_FLIPV];
// int multi_flipv=thispars->pars[P_MULTI_FLIPV];
intold_sensor=prev_selected-1;// may be <0
// int old_sensor=prev_selected-1; // may be <0
intnew_sensor=selected-1;// >=0
// int new_sensor=selected-1; // >=0
if(multi_unitialized&&(!prev_composite)&&(old_sensor>=0)){// was single-sensor mode, copy P_WOI_* to individual sensor WOI and FLIPS
if(multi_unitialized&&(!prev_composite)&&(old_sensor>=0)){// was single-sensor mode, copy P_WOI_* to individual sensor WOI and FLIPS