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-d51de3d6d3f4master
parent
6bc9f636b5
commit
004c5bac06
|
@ -716,6 +716,7 @@ 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. */
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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.*/
|
||||
|
|
|
@ -198,6 +198,7 @@ void gptStartOneShotI(GPTDriver *gptp, gptcnt_t interval) {
|
|||
|
||||
osalDbgCheckClassI();
|
||||
osalDbgCheck(gptp != NULL);
|
||||
osalDbgCheck(gptp->config->callback != NULL);
|
||||
osalDbgAssert(gptp->state == GPT_READY,
|
||||
"invalid state");
|
||||
|
||||
|
|
Loading…
Reference in New Issue