From a708e083e1cf6f6181bcd02baf9cc580f38b5397 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 17 Oct 2014 07:31:40 +0000 Subject: Improvements to the ICU driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7409 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/icu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'os/hal/src') diff --git a/os/hal/src/icu.c b/os/hal/src/icu.c index 92f8a2f1e..9f7a6b6c6 100644 --- a/os/hal/src/icu.c +++ b/os/hal/src/icu.c @@ -134,6 +134,11 @@ void icuStartCapture(ICUDriver *icup) { /** * @brief Waits for a completed capture. + * @note The operation could be performed in polled mode depending on. + * @note In order to use this function notifications must be disabled. + * @pre The driver must be in @p ICU_WAITING or @p ICU_ACTIVE modes. + * @post After the capture is available the driver is in @p ICU_ACTIVE + * mode. * * @param[in] icup pointer to the @p ICUDriver object * @@ -146,7 +151,10 @@ void icuWaitCapture(ICUDriver *icup) { osalSysLock(); osalDbgAssert((icup->state == ICU_WAITING) || (icup->state == ICU_ACTIVE), "invalid state"); - icuWaitCaptureI(icup); + osalDbgAssert(icuAreNotificationsEnabledX(icup) == false, + "notifications enabled"); + icu_lld_wait_capture(icup); + icup->state = ICU_ACTIVE; osalSysUnlock(); } -- cgit v1.2.3