Просмотр исходного кода

ae: use gain/dgain minimum values

Pavel Machek 2 месяцев назад
Родитель
Сommit
47772bde2e
1 измененных файлов с 6 добавлено и 4 удалено
  1. 6 4
      src/process_pipeline.c

+ 6 - 4
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 {