From b2c261eeeefcd94c9c164fa1e8671b7b42997e4d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 17 Oct 2014 12:28:10 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7411 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/icu.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'os/hal/include') diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h index 9d7a06220..f9df3cd6a 100644 --- a/os/hal/include/icu.h +++ b/os/hal/include/icu.h @@ -187,6 +187,7 @@ typedef void (*icucallback_t)(ICUDriver *icup); /** * @brief Common ISR code, ICU period event. + * @note A period event brings the driver into the @p ICU_ACTIVE state. * * @param[in] icup pointer to the @p ICUDriver object * @@ -201,6 +202,8 @@ typedef void (*icucallback_t)(ICUDriver *icup); /** * @brief Common ISR code, ICU timer overflow event. + * @note An overflow always brings the driver back to the @p ICU_WAITING + * state. * * @param[in] icup pointer to the @p ICUDriver object * @@ -208,6 +211,7 @@ typedef void (*icucallback_t)(ICUDriver *icup); */ #define _icu_isr_invoke_overflow_cb(icup) do { \ (icup)->config->overflow_cb(icup); \ + (icup)->state = ICU_WAITING; \ } while (0) /** @} */ @@ -223,7 +227,7 @@ extern "C" { void icuStart(ICUDriver *icup, const ICUConfig *config); void icuStop(ICUDriver *icup); void icuStartCapture(ICUDriver *icup); - void icuWaitCapture(ICUDriver *icup); + bool icuWaitCapture(ICUDriver *icup); void icuStopCapture(ICUDriver *icup); void icuEnableNotifications(ICUDriver *icup); void icuDisableNotifications(ICUDriver *icup); -- cgit v1.2.3