From 0b6c9ab2c0f756474b96485d72ba736995c50f58 Mon Sep 17 00:00:00 2001 From: sakabin Date: Sat, 29 Dec 2018 10:43:30 +0800 Subject: [PATCH] Fix bug with color error when flipping vertically --- sensors/ov2640.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sensors/ov2640.c b/sensors/ov2640.c index 3ef91b2..e1a5b57 100755 --- a/sensors/ov2640.c +++ b/sensors/ov2640.c @@ -414,8 +414,10 @@ static int set_hmirror_sensor(sensor_t *sensor, int enable) static int set_vflip_sensor(sensor_t *sensor, int enable) { + int ret = 0; sensor->status.vflip = enable; - return write_reg_bits(sensor, BANK_SENSOR, REG04, REG04_VFLIP_IMG, enable?1:0); + ret = write_reg_bits(sensor, BANK_SENSOR, REG04, REG04_VREF_EN, enable?1:0); + return ret & write_reg_bits(sensor, BANK_SENSOR, REG04, REG04_VFLIP_IMG, enable?1:0); } static int set_raw_gma_dsp(sensor_t *sensor, int enable)