From 9bcef8e17c5270fdf8caaa979b96fc1d88d7bef6 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Sun, 27 Jul 2025 15:01:45 +0200 Subject: [PATCH] common/csi: Add power-on time. Can be used by driver to check for elapsed time since power-on. Signed-off-by: iabdalkader --- common/omv_csi.c | 4 ++++ common/omv_csi.h | 1 + 2 files changed, 5 insertions(+) diff --git a/common/omv_csi.c b/common/omv_csi.c index 676148138..cae4cbd28 100644 --- a/common/omv_csi.c +++ b/common/omv_csi.c @@ -501,6 +501,9 @@ int omv_csi_probe(omv_i2c_t *i2c) { dev_count = omv_csi_detect(i2c, dev_list); } + // Set the current ms for tracking elapsed time since power-on. + uint32_t power_time_ms = mp_hal_ticks_ms(); + // Add special devices, such as SPI sensors, soft-CSI etc... #if OMV_SOFTCSI_ENABLE if (dev_count < OMV_CSI_MAX_DEVICES) { @@ -533,6 +536,7 @@ int omv_csi_probe(omv_i2c_t *i2c) { csi->reset_pol = reset_pol; csi->chip_id = dev_list[i].chip_id; csi->slv_addr = dev_list[i].slv_addr; + csi->power_time_ms = power_time_ms; // Find the sensors init function. for (size_t i=0; i