From 6d25d9a31fd4ba06f2c32fef890381a474209898 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 26 Nov 2024 14:41:38 +0100 Subject: [PATCH] sensors/mt9v0xx: Fix bayer output. Signed-off-by: iabdalkader --- src/omv/sensors/mt9v0xx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/omv/sensors/mt9v0xx.c b/src/omv/sensors/mt9v0xx.c index 11245fba0..6f0dcd7c9 100644 --- a/src/omv/sensors/mt9v0xx.c +++ b/src/omv/sensors/mt9v0xx.c @@ -153,10 +153,12 @@ static int write_reg(omv_csi_t *csi, uint16_t reg_addr, uint16_t reg_data) { static int set_pixformat(omv_csi_t *csi, pixformat_t pixformat) { switch (cfa_type) { case BAYER_CFA: { - if (pixformat != PIXFORMAT_BAYER) { - return -1; + if (pixformat == PIXFORMAT_RGB565 || + pixformat == PIXFORMAT_BAYER || + pixformat == PIXFORMAT_GRAYSCALE) { + return 0; } - return 0; + return -1; } default: { if (pixformat != PIXFORMAT_GRAYSCALE) { @@ -553,6 +555,7 @@ int mt9v0xx_init(omv_csi_t *csi) { break; } } + csi->raw_output = 1; break; } default: { @@ -560,7 +563,6 @@ int mt9v0xx_init(omv_csi_t *csi) { break; } } - return ret; }