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
ea1834cd
Commit
ea1834cd
authored
Jan 10, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+waitFrame function
parent
d268ee0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
framepars.c
src/drivers/elphel/framepars.c
+15
-2
framepars.h
src/drivers/elphel/framepars.h
+2
-0
No files found.
src/drivers/elphel/framepars.c
View file @
ea1834cd
...
...
@@ -1568,6 +1568,17 @@ int setFramePars(int sensor_port, ///< sensor port number (0
return
0
;
}
/**
* @brief wait for target frame number
* @param sensor_port
* @param frame_num target frame
* @return 0
*/
int
waitFrame
(
int
sensor_port
,
int
frame_num
){
wait_event_interruptible
(
aframepars_wait_queue
[
sensor_port
],
getThisFrameNumber
(
sensor_port
)
>=
frame_num
);
return
0
;
}
//TODO: make some parameters readonly (prohibited from modification from the userland)
// File operations:
// open, release - nop
...
...
@@ -1688,7 +1699,8 @@ loff_t framepars_lseek(struct file * file, loff_t offset, int orig)
// Skip 0..255 frames
// wait_event_interruptible (framepars_wait_queue, getThisFrameNumber()>=target_frame);
dev_dbg
(
g_devfp_ptr
,
"getThisFrameNumber(%d) == 0x%x, target_frame = 0x%x
\n
"
,
sensor_port
,
(
int
)
getThisFrameNumber
(
sensor_port
),
(
int
)
target_frame
);
wait_event_interruptible
(
aframepars_wait_queue
[
sensor_port
],
getThisFrameNumber
(
sensor_port
)
>=
target_frame
);
waitFrame
(
sensor_port
,
target_frame
);
//wait_event_interruptible(aframepars_wait_queue[sensor_port], getThisFrameNumber(sensor_port) >= target_frame);
dev_dbg
(
g_devfp_ptr
,
"getThisFrameNumber(%d) == 0x%x
\n
"
,
sensor_port
,
(
int
)
getThisFrameNumber
(
sensor_port
));
// if (getThisFrameNumber()<target_frame) wait_event_interruptible (framepars_wait_queue,getThisFrameNumber()>=target_frame);
...
...
@@ -1696,7 +1708,8 @@ loff_t framepars_lseek(struct file * file, loff_t offset, int orig)
}
else
{
//! Other lseek commands
switch
(
offset
&
~
0x1f
)
{
case
LSEEK_DAEMON_FRAME
:
// wait the daemon enabled and a new frame interrupt (sensor frame sync)
wait_event_interruptible
(
aframepars_wait_queue
[
sensor_port
],
get_imageParamsThis
(
sensor_port
,
P_DAEMON_EN
)
&
(
1
<<
(
offset
&
0x1f
)));
waitFrame
(
sensor_port
,
get_imageParamsThis
(
sensor_port
,
P_DAEMON_EN
)
&
(
1
<<
(
offset
&
0x1f
)));
//wait_event_interruptible(aframepars_wait_queue[sensor_port], get_imageParamsThis(sensor_port, P_DAEMON_EN) & (1 << (offset & 0x1f)));
break
;
default:
switch
(
offset
)
{
...
...
src/drivers/elphel/framepars.h
View file @
ea1834cd
...
...
@@ -39,6 +39,8 @@ void updateFramePars (int sensor_port, int frame16);
int
setFrameParStatic
(
int
sensor_port
,
unsigned
long
index
,
unsigned
long
val
);
int
setFrameParsStatic
(
int
sensor_port
,
int
numPars
,
struct
frameparspair_t
*
pars
);
int
waitFrame
(
int
sensor_port
,
int
frame_num
);
unsigned
long
getThisFrameNumber
(
int
sensor_port
);
/// just return current thisFrameNumber
/// set parameters for the frame number frameno, knowing that they should be set not less than maxLatency ahead (may be sensor - dependent)
/// Parameters (numPars of them) will be updated all at once, with interrupts disabled
...
...
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