aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/icu.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-10-17 12:28:10 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-10-17 12:28:10 +0000
commitb2c261eeeefcd94c9c164fa1e8671b7b42997e4d (patch)
treecc5413af9fef7661c7e8d55db1d14a88d67e729a /os/hal/include/icu.h
parenta708e083e1cf6f6181bcd02baf9cc580f38b5397 (diff)
downloadChibiOS-b2c261eeeefcd94c9c164fa1e8671b7b42997e4d.tar.gz
ChibiOS-b2c261eeeefcd94c9c164fa1e8671b7b42997e4d.tar.bz2
ChibiOS-b2c261eeeefcd94c9c164fa1e8671b7b42997e4d.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7411 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/icu.h')
-rw-r--r--os/hal/include/icu.h6
1 files changed, 5 insertions, 1 deletions
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);