From 7daf84a1f603b81da6e134150e8cc5b03153d7b3 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Mon, 7 Apr 2025 10:55:30 +0200 Subject: [PATCH] misc/csi: Don't fail if sleep is not implemented. At the very least, sleep will abort the transfer on low-power entry or exit, even if it's not fully supported. --- src/omv/common/omv_csi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/omv/common/omv_csi.c b/src/omv/common/omv_csi.c index b7642ba99..92eed9178 100644 --- a/src/omv/common/omv_csi.c +++ b/src/omv/common/omv_csi.c @@ -584,13 +584,9 @@ __weak int omv_csi_sleep(int enable) { // Disable any ongoing frame capture. omv_csi_abort(true, false); - // Check if the control is supported. - if (csi.sleep == NULL) { - return OMV_CSI_ERROR_CTL_UNSUPPORTED; - } - // Call the sensor specific function. - if (csi.sleep(&csi, enable) != 0) { + if (csi.sleep != NULL && + csi.sleep(&csi, enable) != 0) { return OMV_CSI_ERROR_CTL_FAILED; }