From 47772bde2e70a0785483fb5b3ee9dfb2dbaf4f31 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 4 Sep 2024 11:15:47 +0200 Subject: [PATCH] ae: use gain/dgain minimum values --- src/process_pipeline.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/process_pipeline.c b/src/process_pipeline.c index 22843bf..7b096e8 100644 --- a/src/process_pipeline.c +++ b/src/process_pipeline.c @@ -372,6 +372,9 @@ clamp_control(controlstate *control) if (control->value_req > control->max) { control->value_req = control->max; } + if (control->value_req < control->min) { + control->value_req = control->min; + } } static void @@ -564,16 +567,15 @@ process_aaa() update_exp(&state_proc.dgain, direction); printf("D/Gain + %d\n", state_proc.dgain.value_req); } else { - printf("AE: out of options\n"); - //exit(1); /* HACK HACK don't merge */ + printf("AE: way too dark\n"); } } else if (direction < 0) { // Preview is too bright // Lower the sensor gain first to have less noise - if (state_proc.dgain.value > 256 /* state_proc.dgain.min FIXME */) { + if (state_proc.dgain.value > state_proc.dgain.min) { update_exp(&state_proc.dgain, direction); printf("D/Gain - %d\n", state_proc.gain.value_req); - } else if (state_proc.gain.value > 0) { + } else if (state_proc.gain.value > state_proc.gain.min) { update_exp(&state_proc.gain, direction); printf("Gain - %d\n", state_proc.gain.value_req); } else {