aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/icu.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-08-31 17:21:02 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-08-31 17:21:02 +0000
commit6c97d4f6fb4184c41f6283ce025a7030280a1802 (patch)
tree3c3c5fa9401c3d2aa6a4da4747a31fa0aa9c997a /os/hal/include/icu.h
parent87e4b85755680a122f690f445b8cb320ca4f05ad (diff)
downloadChibiOS-6c97d4f6fb4184c41f6283ce025a7030280a1802.tar.gz
ChibiOS-6c97d4f6fb4184c41f6283ce025a7030280a1802.tar.bz2
ChibiOS-6c97d4f6fb4184c41f6283ce025a7030280a1802.zip
Enhanced ICU driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7211 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/icu.h')
-rw-r--r--os/hal/include/icu.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h
index 1839c214f..0b85aa97b 100644
--- a/os/hal/include/icu.h
+++ b/os/hal/include/icu.h
@@ -183,7 +183,7 @@ typedef void (*icucallback_t)(ICUDriver *icup);
* @notapi
*/
#define _icu_isr_invoke_width_cb(icup) do { \
- if (((icup)->state != ICU_WAITING) && \
+ if (((icup)->state == ICU_ACTIVE) && \
((icup)->config->period_cb != NULL)) \
(icup)->config->width_cb(icup); \
} while (0)
@@ -196,11 +196,10 @@ typedef void (*icucallback_t)(ICUDriver *icup);
* @notapi
*/
#define _icu_isr_invoke_period_cb(icup) do { \
- icustate_t previous_state = (icup)->state; \
- (icup)->state = ICU_ACTIVE; \
- if ((previous_state != ICU_WAITING) && \
+ if (((icup)->state == ICU_ACTIVE) && \
((icup)->config->period_cb != NULL)) \
(icup)->config->period_cb(icup); \
+ (icup)->state = ICU_ACTIVE; \
} while (0)
/**