Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.0 on 2022-01-18 at 14:00 UTC+1 (a few minutes of down time)

Commit 98393574 authored by a1ex's avatar a1ex
Browse files

Fixed race condition in idle actions; restored Clear Screen when idle; ExpSim...

Fixed race condition in idle actions; restored Clear Screen when idle; ExpSim auto => ON during half-shutter press.

--HG--
branch : unified
parent c7d8025c9579
......@@ -369,7 +369,7 @@ LiveView overlays: histogram, zebras, cropmarks, spotmeter, focus peaking, false
**ClearScreen: OFF / HalfShutter / WhenIdle**
Clear image overlays from LiveView display.
Clear bitmap overlays from LiveView display.
* **HalfShutter**: Hold the shutter half-pressed, or the ``*`` button, or DOF preview for around 1 second,
and this will clear all the overlays from the Live View display (audio, zebra, crops, shutter speeds...).
......@@ -379,6 +379,8 @@ LiveView overlays: histogram, zebras, cropmarks, spotmeter, focus peaking, false
* **WhenIdle**: In this mode, all the overlays are erased from the screen (100% clean display) when the camera is idle.
This feature allows you to use an external HDMI recording device.
The overlays (zebras & friends) will be back when you enter the Q menu or when you press the shutter half-way, and then disappear.
.. _focus peaking:
......@@ -1057,7 +1059,9 @@ Miscellanous settings.
* ``ON``: LiveView display image reflects exposure of the final image.
* ``OFF``: LiveView display image does not reflect the exposure, but may be useful for framing and checking focus.
* ``Auto``: ExpSim is disabled during zoom (x5, x10 and MagicZoom) and enabled otherwise.
* ``Auto``: ExpSim is:
- disabled during zoom (x5, x10 and MagicZoom), if shutter is not pressed halfway;
- enabled otherwise.
When ExpSim is off, zebra, histogram, waveform and false color are not displayed.
......
......@@ -718,13 +718,15 @@ PROP_HANDLER( PROP_LV_LENS )
lens_info.lens_step = *((float*)&lsswap);
static unsigned old_focus_dist = 0;
if (get_zoom_overlay_mode()==2 && lv && old_focus_dist && lens_info.focus_dist != old_focus_dist)
if (lv && old_focus_dist && lens_info.focus_dist != old_focus_dist)
{
zoom_overlay_set_countdown(300);
if (get_zoom_overlay_mode()==2) zoom_overlay_set_countdown(300);
idle_wakeup_reset_counters();
}
old_focus_dist = lens_info.focus_dist;
update_stuff();
return prop_cleanup( token, property );
}
......
......@@ -99,7 +99,7 @@ extern void* gui_main_task_functbl;
static int handle_buttons(struct event * event)
{
if (event->type == 0 && event->param != 0x56)
if (event->type == 0 && event->param != 0x5a)
{
idle_wakeup_reset_counters();
}
......
......@@ -61,7 +61,7 @@ void expsim_update()
if (shooting_mode == SHOOTMODE_MOVIE) return;
if (expsim_auto)
{
if (lv_dispsize > 1 || should_draw_zoom_overlay()) set_expsim(0);
if ((lv_dispsize > 1 || should_draw_zoom_overlay()) && !get_halfshutter_pressed()) set_expsim(0);
else set_expsim(1);
}
}
......
......@@ -2528,7 +2528,7 @@ struct menu_entry zebra_menus[] = {
.display = clearscreen_display,
.select = menu_ternary_toggle,
.select_reverse = menu_ternary_toggle_reverse,
.help = "Clear BMP overlay."
.help = "Clear bitmap overlays from LiveView display."
},
/*{
.priv = &focus_graph,
......@@ -2636,6 +2636,7 @@ PROP_HANDLER(PROP_LV_ACTION)
{
zoom_overlay_countdown = 0;
idle_display_undim(); // restore LCD brightness, especially for shutdown
idle_wakeup_reset_counters();
return prop_cleanup( token, property );
}
......@@ -3053,10 +3054,11 @@ TASK_CREATE( "zebra_task", zebra_task, 0, 0x1f, 0x1000 ); */
int idle_countdown_display_dim = 100;
int idle_countdown_display_off = 100;
int idle_countdown_globaldraw = 100;
//~ int idle_countdown_display_clear = 100;
int idle_countdown_clrscr = 100;
int idle_countdown_display_dim_prev = 100;
int idle_countdown_display_off_prev = 100;
int idle_countdown_globaldraw_prev = 100;
int idle_countdown_clrscr_prev = 100;
void idle_wakeup_reset_counters()
{
......@@ -3064,8 +3066,10 @@ void idle_wakeup_reset_counters()
idle_countdown_display_off = idle_display_turn_off_after * 10;
idle_countdown_display_dim = idle_display_dim_after * 10;
idle_countdown_globaldraw = idle_display_global_draw_off_after * 10;
idle_countdown_clrscr = 30;
}
// called at 10 Hz
void update_idle_countdown(int* countdown)
{
//~ bmp_printf(FONT_MED, 200, 200, "%d ", *countdown);
......@@ -3086,18 +3090,23 @@ void update_idle_countdown(int* countdown)
void idle_action_do(int* countdown, int* prev_countdown, void(*action_on)(void), void(*action_off)(void))
{
update_idle_countdown(countdown);
//~ bmp_printf(FONT_MED, 100, 200, "%d->%d ", *prev_countdown, *countdown);
if (*prev_countdown && !*countdown)
int c = *countdown; // *countdown may be changed by "wakeup" => race condition
//~ bmp_printf(FONT_MED, 100, 200, "%d->%d ", *prev_countdown, c);
if (*prev_countdown && !c)
{
//~ bmp_printf(FONT_MED, 100, 200, "action "); msleep(500);
action_on();
//~ msleep(500);
//~ bmp_printf(FONT_MED, 100, 200, " ");
}
else if (!*prev_countdown && *countdown)
else if (!*prev_countdown && c)
{
//~ bmp_printf(FONT_MED, 100, 200, "unaction"); msleep(500);
action_off();
//~ msleep(500);
//~ bmp_printf(FONT_MED, 100, 200, " ");
}
*prev_countdown = *countdown;
*prev_countdown = c;
}
void idle_display_off()
......@@ -3112,6 +3121,15 @@ void idle_display_on()
display_on_force();
}
void idle_bmp_off()
{
BMP_SEM(bmp_off);
}
void idle_bmp_on()
{
BMP_SEM(bmp_on);
}
int old_backlight_level = 0;
void idle_display_dim()
{
......@@ -3157,7 +3175,7 @@ clearscreen_loop:
card_led_blink(2, 50, 50);
// clear overlays on shutter halfpress
if (clearscreen && get_halfshutter_pressed())
if (clearscreen == 1 && get_halfshutter_pressed())
{
BMP_SEM( clrscr_mirror(); )
int i;
......@@ -3184,6 +3202,9 @@ clearscreen_loop:
if (idle_display_global_draw_off_after)
idle_action_do(&idle_countdown_globaldraw, &idle_countdown_globaldraw_prev, idle_globaldraw_dis, idle_globaldraw_en);
if (clearscreen == 2) // clear overlay when idle
idle_action_do(&idle_countdown_clrscr, &idle_countdown_clrscr_prev, idle_bmp_off, idle_bmp_on);
}
}
......
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