diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-01-28 15:48:05 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-01-28 15:48:05 +0000 |
commit | 3a41c23cf7bf054da38545bcffac7e6e2cd8fcb4 (patch) | |
tree | 171cd66f56b90739996f60b0955ee5e598bb49fa /os | |
parent | e4828a13e579f8bdbb92bd705b40604c5ade1063 (diff) | |
download | ChibiOS-3a41c23cf7bf054da38545bcffac7e6e2cd8fcb4.tar.gz ChibiOS-3a41c23cf7bf054da38545bcffac7e6e2cd8fcb4.tar.bz2 ChibiOS-3a41c23cf7bf054da38545bcffac7e6e2cd8fcb4.zip |
Fixed bug #461.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6651 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/dox/icu.dox | 2 | ||||
-rw-r--r-- | os/hal/include/icu.h | 6 | ||||
-rw-r--r-- | os/hal/platforms/STM32/TIMv1/icu_lld.c | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/os/hal/dox/icu.dox b/os/hal/dox/icu.dox index 1d3fe092e..76506c10a 100644 --- a/os/hal/dox/icu.dox +++ b/os/hal/dox/icu.dox @@ -54,6 +54,7 @@ ready -> waiting [label="\nicuEnable()"];
waiting -> active [label="\nStart Front"];
waiting -> ready [label="\nicuDisable()"];
+ waiting -> waiting [label="\nStop Front"];
active -> idle [label="\nStop Front\n>width_cb<"];
active -> ready [label="\nicuDisable()\nicuDisableI()"];
idle -> active [label="\nStart Front\n>period_cb<"];
@@ -83,6 +84,7 @@ ready -> waiting [label="\nicuEnable()"];
waiting -> active [label="\nStart Front"];
waiting -> ready [label="\nicuDisable()"];
+ waiting -> waiting [label="\nStop Front"];
active -> idle [label="\nStop Front\n>width_cb<"];
active -> ready [label="\nicuDisable()\nicuDisableI()"];
idle -> active [label="\nStart Front\n>period_cb<"];
diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h index ef42470cb..7db895fbf 100644 --- a/os/hal/include/icu.h +++ b/os/hal/include/icu.h @@ -140,8 +140,10 @@ typedef void (*icucallback_t)(ICUDriver *icup); * @notapi
*/
#define _icu_isr_invoke_width_cb(icup) { \
- (icup)->state = ICU_IDLE; \
- (icup)->config->width_cb(icup); \
+ if ((icup)->state != ICU_WAITING) { \
+ (icup)->state = ICU_IDLE; \
+ (icup)->config->width_cb(icup); \
+ } \
}
/**
diff --git a/os/hal/platforms/STM32/TIMv1/icu_lld.c b/os/hal/platforms/STM32/TIMv1/icu_lld.c index b407d33ae..0b1013a23 100644 --- a/os/hal/platforms/STM32/TIMv1/icu_lld.c +++ b/os/hal/platforms/STM32/TIMv1/icu_lld.c @@ -614,6 +614,7 @@ void icu_lld_stop(ICUDriver *icup) { */
void icu_lld_enable(ICUDriver *icup) {
+ icup->tim->EGR |= STM32_TIM_EGR_UG;
icup->tim->SR = 0; /* Clear pending IRQs (if any). */
if (icup->config->channel == ICU_CHANNEL_1) {
if (icup->config->period_cb != NULL)
|