Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
780762f1
Commit
780762f1
authored
Sep 06, 2019
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. updated comments
2. added changes to mt9f002 sensor, lepton does not have this
parent
40434e01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
mt9f002.c
src/drivers/elphel/mt9f002.c
+11
-5
mt9x001.c
src/drivers/elphel/mt9x001.c
+2
-2
No files found.
src/drivers/elphel/mt9f002.c
View file @
780762f1
...
...
@@ -299,7 +299,9 @@ int mt9f002_pgm_detectsensor (int sensor_port, ///< sensor port
int
regaddr
,
regval
,
regnum
;
int
nupdate
=
0
;
int
colamp_gain
,
a2_gain
,
gain
,
a2_inc
;
u32
i2c_read_data_dw
[
256
];
// 09/05/2019: commented out, made regs read directly to sensor_reg_copy, otherwise get various kernel panics
// because of i2c_read_data_dw[256] array - huge variable in stack
//u32 i2c_read_data_dw[256];
int
color
;
struct
frameparspair_t
pars_to_update
[
262
+
(
MAX_SENSORS
*
P_MULTI_NUMREGS
)];
// for all the sensor registers. Other P_* values will reuse the same ones
...
...
@@ -464,23 +466,27 @@ int mt9f002_pgm_detectsensor (int sensor_port, ///< sensor port
regaddr
=
pSensorPortConfig
[
sensor_port
].
par2addr
[
0
][
i
];
if
(
!
(
regaddr
&
0xffff0000
)){
// TODO: get rid of i2c_addr
X3X3_I2C_RCV2
(
sensor_port
,
sensor
->
i2c_addr
,
regaddr
,
&
i2c_read_data_dw
[
i
]
);
X3X3_I2C_RCV2
(
sensor_port
,
sensor
->
i2c_addr
,
regaddr
,
&
(
sensor_reg_copy
[
sensor_port
][
i
])
);
}
else
{
i2c_read_data_dw
[
i
]
=
0
;
sensor_reg_copy
[
sensor_port
]
[
i
]
=
0
;
}
}
dev_dbg
(
g_dev_ptr
,
"Read 256 registers (port=%d) ID=0x%x:
\n
"
,
sensor_port
,
i2c_read_data_dw
[
0
]);
dev_dbg
(
g_dev_ptr
,
"Read 256 registers (port=%d) ID=0x%x:
\n
"
,
sensor_port
,
sensor_reg_copy
[
sensor_port
]
[
0
]);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
// possible to modify register range to save (that is why nupdate is separate from i)
regval
=
i2c_read_data_dw
[
i
];
regval
=
sensor_reg_copy
[
sensor_port
]
[
i
];
regnum
=
P_SENSOR_REGS
+
i
;
SETFRAMEPARS_SET
(
regnum
,
regval
);
}
// 09/05/2019: commented out, made regs read directly to sensor_reg_copy, otherwise get various kernel panics
// because of i2c_read_data_dw[256] array - huge variable in stack
/*
for (i=0;i<256;i++) {
sensor_reg_copy[sensor_port][i] = i2c_read_data_dw[i];
}
*/
// in mt9x00x there's setFrameParsStatic-call ?!!! Parameters that never change?
if
(
nupdate
)
setFrameParsStatic
(
sensor_port
,
nupdate
,
pars_to_update
);
// save changes to sensor register shadows for all frames
...
...
src/drivers/elphel/mt9x001.c
View file @
780762f1
...
...
@@ -995,7 +995,7 @@ int mt9x001_pgm_initsensor (int sensor_port, ///< sensor port
x393_sensio_ctl_t
sensio_ctl
=
{.
d32
=
0
};
// 09/05/2019: commented out, made regs read directly to sensor_reg_copy, otherwise get various kernel panics
// because of i2c_read_data_dw[256] array
?
// because of i2c_read_data_dw[256] array
- huge variable in stack
//u32 i2c_read_data_dw[256];
int
nupdate
=
0
;
...
...
@@ -1046,7 +1046,7 @@ int mt9x001_pgm_initsensor (int sensor_port, ///< sensor port
}
}
// 09/05/2019: commented out, made regs read directly to sensor_reg_copy, otherwise get various kernel panics
// because of i2c_read_data_dw[256] array
?
// because of i2c_read_data_dw[256] array
- huge variable in stack
/*
for (i=0;i<256;i++) {
sensor_reg_copy[sensor_port][i] = i2c_read_data_dw[i];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment