From 33f7923d7247fdbb34fe92821c9ef9e418533361 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Thu, 21 Dec 2023 13:40:57 +0900 Subject: [PATCH] drivers/video/isx019: Fix bug that initial exposure time is not correct Because exposure time calculation needs the cxd56xx clock value, get the cxd56xx clock value before saving initial value. --- drivers/video/isx019.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/video/isx019.c b/drivers/video/isx019.c index ea089bd0ad..a763328c94 100644 --- a/drivers/video/isx019.c +++ b/drivers/video/isx019.c @@ -1354,9 +1354,14 @@ static int isx019_init(FAR struct imgsensor_s *sensor) fpga_init(priv); initialize_wbmode(priv); initialize_jpg_quality(priv); - store_default_value(priv); + + /* Because store_default_value() needs the clock ratio, + * clock_ratio has to be calculated first. + */ + clk = board_isx019_get_master_clock(); priv->clock_ratio = (float)clk / ISX019_STANDARD_MASTER_CLOCK; + store_default_value(priv); return OK; }