diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-08-31 17:21:02 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-08-31 17:21:02 +0000 |
commit | 6c97d4f6fb4184c41f6283ce025a7030280a1802 (patch) | |
tree | 3c3c5fa9401c3d2aa6a4da4747a31fa0aa9c997a /os/hal/include/icu.h | |
parent | 87e4b85755680a122f690f445b8cb320ca4f05ad (diff) | |
download | ChibiOS-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.h | 7 |
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)
/**
|