From 80747678ab3895756e8938a531a25d4fd3d8f02f Mon Sep 17 00:00:00 2001 From: Peter Hoddie Date: Thu, 17 Apr 2025 17:44:36 -0700 Subject: [PATCH] contrast fixes - update sensor->status.contrast when setting contrast (consistent with most other settings like hmirror) - initialize sensor->status.contrast to the actual default (50) rather than 0, which is invalid --- sensors/gc0308.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sensors/gc0308.c b/sensors/gc0308.c index 09d333183a..337626cc14 100644 --- a/sensors/gc0308.c +++ b/sensors/gc0308.c @@ -279,7 +279,8 @@ static int set_framesize(sensor_t *sensor, framesize_t framesize) static int set_contrast(sensor_t *sensor, int contrast) { - if (contrast != 0) { + if (contrast > 0) { + sensor->status.contrast = contrast; write_reg(sensor->slv_addr, 0xfe, 0x00); write_reg(sensor->slv_addr, 0xb3, contrast); } @@ -370,7 +371,7 @@ static int init_status(sensor_t *sensor) { write_reg(sensor->slv_addr, 0xfe, 0x00); sensor->status.brightness = 0; - sensor->status.contrast = 0; + sensor->status.contrast = 50; sensor->status.saturation = 0; sensor->status.sharpness = 0; sensor->status.denoise = 0;