Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
magic-lantern
magic-lantern
Commits
a13ca46c127e
Commit
5f5a7a23
authored
Jan 24, 2017
by
alex@thinkpad
Browse files
lens_take_picture: wait for file number to change before returning; minor cleanups
--HG-- branch : lua_fix
parent
b3a730845550
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lens.c
View file @
a13ca46c
...
...
@@ -804,10 +804,20 @@ lens_take_picture(
int
should_af
)
{
if
(
ml_taking_pic
)
return
-
1
;
if
(
ml_taking_pic
)
{
return
-
1
;
}
ml_taking_pic
=
1
;
if
(
should_af
!=
AF_DONT_CHANGE
)
lens_setup_af
(
should_af
);
int
file_number_before
=
get_shooting_card
()
->
file_number
;
if
(
should_af
!=
AF_DONT_CHANGE
)
{
lens_setup_af
(
should_af
);
}
//~ take_semaphore(lens_sem, 0);
lens_wait_readytotakepic
(
64
);
...
...
@@ -857,27 +867,45 @@ lens_take_picture(
SW1
(
0
,
0
);
#endif
end:
end:
;
int
ret
=
0
;
if
(
!
wait
)
{
//~ give_semaphore(lens_sem);
if
(
should_af
!=
AF_DONT_CHANGE
)
lens_cleanup_af
();
ml_taking_pic
=
0
;
return
0
;
goto
finish
;
}
else
{
msleep
(
200
);
if
(
drive_mode
==
DRIVE_SELFTIMER_2SEC
)
msleep
(
2000
);
if
(
drive_mode
==
DRIVE_SELFTIMER_REMOTE
||
drive_mode
==
DRIVE_SELFTIMER_CONTINUOUS
)
msleep
(
10000
);
if
(
drive_mode
==
DRIVE_SELFTIMER_2SEC
)
{
msleep
(
2000
);
}
if
(
drive_mode
==
DRIVE_SELFTIMER_REMOTE
||
drive_mode
==
DRIVE_SELFTIMER_CONTINUOUS
)
{
msleep
(
10000
);
}
lens_wait_readytotakepic
(
wait
);
while
(
get_shooting_card
()
->
file_number
==
file_number_before
)
{
msleep
(
50
);
}
//~ give_semaphore(lens_sem);
if
(
should_af
!=
AF_DONT_CHANGE
)
lens_cleanup_af
();
ml_taking_pic
=
0
;
return
lens_info
.
job_state
;
ret
=
lens_info
.
job_state
;
goto
finish
;
}
finish:
if
(
should_af
!=
AF_DONT_CHANGE
)
{
lens_cleanup_af
();
}
ml_taking_pic
=
0
;
return
ret
;
}
#ifdef FEATURE_MOVIE_LOGGING
...
...
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