Skip to content

Commit a186c72

Browse files
hfruchet-stcfriedt
authored andcommitted
drivers: video: stm32_venc: log an error in case of hardware timeout
Log an error in case of hardware timeout. Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
1 parent 8ad4282 commit a186c72

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/video/video_stm32_venc.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ i32 EWLWaitHwRdy(const void *instance, uint32_t *slicesReady)
326326
{
327327
struct stm32_venc_ewl *inst = (struct stm32_venc_ewl *)instance;
328328
const struct stm32_venc_config *config = inst->config;
329-
uint32_t ret = EWL_HW_WAIT_TIMEOUT;
329+
int32_t ret = EWL_HW_WAIT_TIMEOUT;
330330
volatile uint32_t irq_stats;
331331
uint32_t prevSlicesReady = 0;
332332
k_timepoint_t timeout = sys_timepoint_calc(K_MSEC(EWL_TIMEOUT));
@@ -380,13 +380,18 @@ i32 EWLWaitHwRdy(const void *instance, uint32_t *slicesReady)
380380

381381
} while (!sys_timepoint_expired(timeout));
382382

383+
if (ret != EWL_OK) {
384+
LOG_ERR("Timeout");
385+
return ret;
386+
}
387+
383388
LOG_DBG("encoding = %d ms", k_ticks_to_ms_ceil32(sys_clock_tick_get_32() - start));
384389

385390
if (slicesReady != NULL) {
386391
LOG_DBG("slicesReady = %d", *slicesReady);
387392
}
388393

389-
return ret;
394+
return EWL_OK;
390395
}
391396

392397
void EWLassert(bool expr, const char *str_expr, const char *file, unsigned int line)

0 commit comments

Comments
 (0)