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 {