diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-03-08 17:41:14 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-03-08 17:41:14 +0000 |
commit | 004c5bac0656683f315cf4baf57c2bb90e9453fb (patch) | |
tree | bb9af5fd72de61298dd9bfb68df2fac9749e58f4 /os/hal/ports/STM32 | |
parent | 6bc9f636b5488434375da0296a3d90285dc1cec4 (diff) | |
download | ChibiOS-004c5bac0656683f315cf4baf57c2bb90e9453fb.tar.gz ChibiOS-004c5bac0656683f315cf4baf57c2bb90e9453fb.tar.bz2 ChibiOS-004c5bac0656683f315cf4baf57c2bb90e9453fb.zip |
GPT is usable without callbacks now (trigger, counter).
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6760 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r-- | os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c | 3 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c b/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c index 2852f383a..75c19f6b2 100644 --- a/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c +++ b/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c @@ -716,7 +716,8 @@ void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval) { SR bit 0 goes to 1. This is because the clearing of CNT has been inserted
before the clearing of SR, to give it some time.*/
gptp->tim->SR = 0; /* Clear pending IRQs. */
- gptp->tim->DIER |= STM32_TIM_DIER_UIE; /* Update Event IRQ enabled.*/
+ if (NULL != gptp->config->callback)
+ gptp->tim->DIER |= STM32_TIM_DIER_UIE; /* Update Event IRQ enabled.*/
gptp->tim->CR1 = STM32_TIM_CR1_URS | STM32_TIM_CR1_CEN;
}
diff --git a/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h b/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h index 9f0b16980..7146a9c3c 100644 --- a/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h +++ b/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h @@ -383,6 +383,8 @@ typedef struct { /**
* @brief Timer callback pointer.
* @note This callback is invoked on GPT counter events.
+ * @note This callback can be set to @p NULL but in that case the
+ * one-shot mode cannot be used.
*/
gptcallback_t callback;
/* End of the mandatory fields.*/
|