Commit a8a661b1 authored by Andrey Filippov's avatar Andrey Filippov

corrected re-trigger with imgsrv

parent 6e54d11c
...@@ -2615,18 +2615,9 @@ int pgm_trigseq (int sensor_port, ///< sensor port number (0..3 ...@@ -2615,18 +2615,9 @@ int pgm_trigseq (int sensor_port, ///< sensor port number (0..3
// dev_dbg(g_dev_ptr,"{%d} port_csp0_addr[0x%x]=0x%x\n",sensor_port, (int) X313_WA_IOPINS, (int) X313_WA_IOPINS_DIS_TRIG_OUT); // dev_dbg(g_dev_ptr,"{%d} port_csp0_addr[0x%x]=0x%x\n",sensor_port, (int) X313_WA_IOPINS, (int) X313_WA_IOPINS_DIS_TRIG_OUT);
} }
} }
// Sequencer period changed? (0 - stopped, 1 - single trigger, >=256 - start repetitive)
if (FRAMEPAR_MODIFIED(P_TRIG_PERIOD)) {
if (unlikely((thispars->pars[P_TRIG_PERIOD] > 1) && (thispars->pars[P_TRIG_PERIOD] < 256))) { // Wrong value, restore old one
SETFRAMEPARS_SET(P_TRIG_PERIOD,prevpars->pars[P_TRIG_PERIOD]); //+1
} else {
set_x393_camsync_trig_period(thispars->pars[P_TRIG_PERIOD]);
update_master_channel=1;
dev_dbg(g_dev_ptr,"{%d} set_x393_camsync_trig_period(0x%lx)\n",sensor_port, thispars->pars[P_TRIG_PERIOD]);
MDP(DBGB_PADD, sensor_port,"set_x393_camsync_trig_period(0x%lx)\n", thispars->pars[P_TRIG_PERIOD])
}
}
// Bit length changed or not yet initialized? // Bit length changed or not yet initialized?
// Put before period to help re-trigger with the same period as was before
// Alternatively - make retrigger always single?
if (FRAMEPAR_MODIFIED(P_TRIG_BITLENGTH) || (thispars->pars[P_TRIG_BITLENGTH]==0)) { if (FRAMEPAR_MODIFIED(P_TRIG_BITLENGTH) || (thispars->pars[P_TRIG_BITLENGTH]==0)) {
d=thispars->pars[P_TRIG_BITLENGTH]; d=thispars->pars[P_TRIG_BITLENGTH];
if (unlikely((d<2) || (d>255))) { // Wrong value, restore old one if (unlikely((d<2) || (d>255))) { // Wrong value, restore old one
...@@ -2638,6 +2629,17 @@ int pgm_trigseq (int sensor_port, ///< sensor port number (0..3 ...@@ -2638,6 +2629,17 @@ int pgm_trigseq (int sensor_port, ///< sensor port number (0..3
dev_dbg(g_dev_ptr,"{%d} set_x393_camsync_trig_period(0x%x) (bit length)\n",sensor_port, d); dev_dbg(g_dev_ptr,"{%d} set_x393_camsync_trig_period(0x%x) (bit length)\n",sensor_port, d);
MDP(DBGB_PADD, sensor_port,"set_x393_camsync_trig_period(0x%x) (bit length)\n",d) MDP(DBGB_PADD, sensor_port,"set_x393_camsync_trig_period(0x%x) (bit length)\n",d)
} }
// Sequencer period changed? (0 - stopped, 1 - single trigger, >=256 - start repetitive)
if (FRAMEPAR_MODIFIED(P_TRIG_PERIOD)) {
if (unlikely((thispars->pars[P_TRIG_PERIOD] > 1) && (thispars->pars[P_TRIG_PERIOD] < 256))) { // Wrong value, restore old one
SETFRAMEPARS_SET(P_TRIG_PERIOD,prevpars->pars[P_TRIG_PERIOD]); //+1
} else {
set_x393_camsync_trig_period(thispars->pars[P_TRIG_PERIOD]);
update_master_channel=1;
dev_dbg(g_dev_ptr,"{%d} set_x393_camsync_trig_period(0x%lx)\n",sensor_port, thispars->pars[P_TRIG_PERIOD]);
MDP(DBGB_PADD, sensor_port,"set_x393_camsync_trig_period(0x%lx)\n", thispars->pars[P_TRIG_PERIOD])
}
}
// P_EXTERN_TIMESTAMP changed? (0 - internal sequencer) // P_EXTERN_TIMESTAMP changed? (0 - internal sequencer)
if (FRAMEPAR_MODIFIED(P_EXTERN_TIMESTAMP)) { if (FRAMEPAR_MODIFIED(P_EXTERN_TIMESTAMP)) {
camsync_mode.ext = thispars->pars[P_EXTERN_TIMESTAMP]?1:0; camsync_mode.ext = thispars->pars[P_EXTERN_TIMESTAMP]?1:0;
......
...@@ -1001,7 +1001,7 @@ void sensor_interrupts (int on, ///< 0 -interrupt disable, 1 - interrupt enabl ...@@ -1001,7 +1001,7 @@ void sensor_interrupts (int on, ///< 0 -interrupt disable, 1 - interrupt enabl
void trigger_restart(void) void trigger_restart(void)
{ {
u32 period = get_x393_camsync_trig_period(); u32 period = get_x393_camsync_trig_period();
if (!period) period = 1; if (!(period & ~31)) period = 1; // if 0 or bit length setup
set_x393_camsync_trig_period(period); set_x393_camsync_trig_period(period);
dev_dbg(g_dev_ptr, "Reset trigger period in immediate mode = %d (0x%x)\n", (int) period, (int) period); dev_dbg(g_dev_ptr, "Reset trigger period in immediate mode = %d (0x%x)\n", (int) period, (int) period);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment