diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-04-01 09:31:28 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-04-01 09:31:28 +0000 |
commit | 875a7d8f4151039f4c47b05c0d4f196575b8d109 (patch) | |
tree | a5acacb99770a92d5b9cc43a4dfc37fc05b686c6 /os/hal/include/icu.h | |
parent | be4c72c7a3e9e11a23ad5d6de709957adffa06ff (diff) | |
download | ChibiOS-875a7d8f4151039f4c47b05c0d4f196575b8d109.tar.gz ChibiOS-875a7d8f4151039f4c47b05c0d4f196575b8d109.tar.bz2 ChibiOS-875a7d8f4151039f4c47b05c0d4f196575b8d109.zip |
Shared ISR code moved in icu.h.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2860 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/icu.h')
-rw-r--r-- | os/hal/include/icu.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h index b51345c4d..8a89281ae 100644 --- a/os/hal/include/icu.h +++ b/os/hal/include/icu.h @@ -119,6 +119,32 @@ typedef void (*icucallback_t)(ICUDriver *icup); */
#define icuGetPeriodI(icup) icu_lld_get_period(icup)
+/**
+ * @brief Common ISR code, ICU width event.
+ *
+ * @param[in] icup pointer to the @p ICUDriver object
+ *
+ * @notapi
+ */
+#define _icu_isr_invoke_width_cb(usbp) { \
+ (icup)->state = ICU_IDLE; \
+ (icup)->config->width_cb(icup); \
+}
+
+/**
+ * @brief Common ISR code, ICU period event.
+ *
+ * @param[in] icup pointer to the @p ICUDriver object
+ *
+ * @notapi
+ */
+#define _icu_isr_invoke_period_cb(usbp) { \
+ icustate_t previous_state = (icup)->state; \
+ (icup)->state = ICU_ACTIVE; \
+ if (previous_state != ICU_WAITING) \
+ (icup)->config->period_cb(icup); \
+}
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
|