From ca38049a5796256e4a00212a5192819aa53cb4a3 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 22 Oct 2025 11:49:52 +0800 Subject: [PATCH] Update framesize validation to check FRAMESIZE_5MP Change error logging from error to warning for invalid framesize and set framesize to FRAMESIZE_5MP if it exceeds the limit. --- sensors/ov5640.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sensors/ov5640.c b/sensors/ov5640.c index a32b374f54..2d32e7eebe 100755 --- a/sensors/ov5640.c +++ b/sensors/ov5640.c @@ -384,9 +384,9 @@ static int set_framesize(sensor_t *sensor, framesize_t framesize) framesize_t old_framesize = sensor->status.framesize; sensor->status.framesize = framesize; - if(framesize > FRAMESIZE_QSXGA){ - ESP_LOGE(TAG, "Invalid framesize: %u", framesize); - return -1; + if (framesize > FRAMESIZE_5MP) { + ESP_LOGW(TAG, "Invalid framesize: %u", framesize); + framesize = FRAMESIZE_5MP; } uint16_t w = resolution[framesize].width; uint16_t h = resolution[framesize].height;