From 0f9456fd37bedb656062b338ee78eeaf15fd4174 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 13 Dec 2016 21:57:10 +0200 Subject: [PATCH] Use WFI while waiting for snapshots. --- src/omv/sensor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/omv/sensor.c b/src/omv/sensor.c index 6d156137c..fd3e16799 100644 --- a/src/omv/sensor.c +++ b/src/omv/sensor.c @@ -686,6 +686,9 @@ int sensor_snapshot(image_t *image, line_filter_t line_filter_func, void *line_f // Wait for frame while ((DCMI->CR & DCMI_CR_CAPTURE) != 0) { + // Wait for interrupt + __WFI(); + if ((HAL_GetTick() - tick_start) >= 3000) { // Sensor timeout, most likely a HW issue. // Abort the DMA request.