Commit 2e9264a2 authored by Andrey Filippov's avatar Andrey Filippov

working w/o second init_sensor

parent 83cfb429
...@@ -838,6 +838,7 @@ int boson640_is_booted ( int sensor_port, ...@@ -838,6 +838,7 @@ int boson640_is_booted ( int sensor_port,
dev_dbg(g_dev_ptr,"boson640_is_booted(): Not yet fully booted{%d}, frame %d < %d, P_COLOR =%ld\n",sensor_port, cframe, BOSON640_BOOT_FRAME,thispars->pars[P_COLOR]); dev_dbg(g_dev_ptr,"boson640_is_booted(): Not yet fully booted{%d}, frame %d < %d, P_COLOR =%ld\n",sensor_port, cframe, BOSON640_BOOT_FRAME,thispars->pars[P_COLOR]);
return 0; // too early return 0; // too early
} }
// setFramePar(sensor_port, thispars, P_BOOTED | FRAMEPAIR_FORCE_PROC, 1); // should initiate pgm_initsensor and others?
setFramePar(sensor_port, thispars, P_BOOTED, 1); // should initiate pgm_initsensor and others? setFramePar(sensor_port, thispars, P_BOOTED, 1); // should initiate pgm_initsensor and others?
// dev_warn(g_dev_ptr,"boson640_is_booted(): Just fully booted{%d}\n",sensor_port); // dev_warn(g_dev_ptr,"boson640_is_booted(): Just fully booted{%d}\n",sensor_port);
dev_warn(g_dev_ptr,"boson640_is_booted(): Just fully booted{%d}, P_COLOR =%ld\n",sensor_port,thispars->pars[P_COLOR]); dev_warn(g_dev_ptr,"boson640_is_booted(): Just fully booted{%d}, P_COLOR =%ld\n",sensor_port,thispars->pars[P_COLOR]);
...@@ -949,16 +950,11 @@ int boson640_pgm_initsensor (int sensor_port, ///< sensor port ...@@ -949,16 +950,11 @@ int boson640_pgm_initsensor (int sensor_port, ///< sensor port
///x393_sensio_tim1_t uart_ctl = {.d32=0}; ///x393_sensio_tim1_t uart_ctl = {.d32=0};
u32 data32; u32 data32;
int i, rslt; // ,color; int i, rslt; // ,color;
dev_dbg(g_dev_ptr,"boson640_pgm_initsensor(): {%d} frame16=%d frame=%ld\n",sensor_port,frame16,getThisFrameNumber(sensor_port)); dev_info(g_dev_ptr,"boson640_pgm_initsensor(): {%d} frame16=%d frame=%ld\n",sensor_port,frame16,getThisFrameNumber(sensor_port));
if (frame16 >= 0) return -1; // should be ASAP if (frame16 >= 0) return -1; // should be ASAP
if (boson640_is_booted (sensor_port, thispars) < 2){ // not yet booted
return -1; // Not yet fully booted.
}
// Was disabled // Was disabled
#if 1 #if 0
// reset both sequencers to frame 0 // reset both sequencers to frame 0
sequencer_stop_run_reset(sensor_port, SEQ_CMD_RESET); sequencer_stop_run_reset(sensor_port, SEQ_CMD_RESET);
sequencer_stop_run_reset(sensor_port, SEQ_CMD_RUN); // also programs status update sequencer_stop_run_reset(sensor_port, SEQ_CMD_RUN); // also programs status update
...@@ -970,6 +966,12 @@ int boson640_pgm_initsensor (int sensor_port, ///< sensor port ...@@ -970,6 +966,12 @@ int boson640_pgm_initsensor (int sensor_port, ///< sensor port
set_sensor_uart_ctl_boson (sensor_port, uart_extif_en[sensor_port], -1, -1, 0, 0); set_sensor_uart_ctl_boson (sensor_port, uart_extif_en[sensor_port], -1, -1, 0, 0);
dev_info(g_dev_ptr,"boson640_pgm_initsensor(): {%d} frame16=%d frame=%ld: Enable EXTIF (Boson UART control from the sequencer)\n",sensor_port,frame16,getThisFrameNumber(sensor_port)); dev_info(g_dev_ptr,"boson640_pgm_initsensor(): {%d} frame16=%d frame=%ld: Enable EXTIF (Boson UART control from the sequencer)\n",sensor_port,frame16,getThisFrameNumber(sensor_port));
if (boson640_is_booted (sensor_port, thispars) < 2){ // not yet booted
dev_info(g_dev_ptr,"boson640_pgm_initsensor(): {%d} frame16=%d frame=%ld ABORTED as Boson not yet booted\n",sensor_port,frame16,getThisFrameNumber(sensor_port));
return -1; // Not yet fully booted.
}
// boson640_par2addr // boson640_par2addr
// read shadows from the sensor, ignore errors // read shadows from the sensor, ignore errors
......
...@@ -870,14 +870,14 @@ ssize_t xi2c_read(struct file * file, char * buf, size_t count, loff_t *off) { ...@@ -870,14 +870,14 @@ ssize_t xi2c_read(struct file * file, char * buf, size_t count, loff_t *off) {
unsigned long p; unsigned long p;
int error; int error;
char * bbitdelays= (char*) bitdelays; char * bbitdelays= (char*) bitdelays;
p = *off;
int bus=0;
unsigned char * i2cbuf=&i2cbuf_all[0]; // initialize to keep compiler happy
unsigned char * userbuf=&i2cbuf[1];
int thissize=sizes[(int)file->private_data];
int slave_adr; int slave_adr;
int thissize=sizes[(int)file->private_data];
int en_mask=0; int en_mask=0;
int en_bits=0; int en_bits=0;
int bus=0;
unsigned char * i2cbuf=&i2cbuf_all[0]; // initialize to keep compiler happy
unsigned char * userbuf=&i2cbuf[1];
p = *off;
// switch (((int *)file->private_data)[0]) { // switch (((int *)file->private_data)[0]) {
switch ((int)file->private_data) { switch ((int)file->private_data) {
......
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