git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13277 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2020-01-17 08:57:32 +00:00
parent 2af65517ae
commit 0ed9d3d322
3 changed files with 24 additions and 17 deletions

View File

@ -111,6 +111,23 @@ typedef void (*gptcallback_t)(GPTDriver *gptp);
*/
#define gptGetCounterX(gptp) gpt_lld_get_counter(gptp)
/**
* @brief Common ISR code, GPT period event.
*
* @param[in] gptp pointer to the @p GPTDriver object
*
* @notapi
*/
#define _gpt_isr_invoke_cb(gptp) do { \
if ((gptp)->state == GPT_ONESHOT) { \
(gptp)->state = GPT_READY; \
gpt_lld_stop_timer(gptp); \
} \
if ((gptp)->config->callback != NULL) { \
(gptp)->config->callback(gptp); \
} \
} while (0)
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

View File

@ -822,18 +822,6 @@ void gpt_lld_start(GPTDriver *gptp) {
}
#endif
#if STM32_GPT_USE_TIM15
if (&GPTD15 == gptp) {
rccEnableTIM15(true);
rccResetTIM15();
#if defined(STM32_TIM15CLK)
gptp->clock = STM32_TIM15CLK;
#else
gptp->clock = STM32_TIMCLK2;
#endif
}
#endif
#if STM32_GPT_USE_TIM16
if (&GPTD16 == gptp) {
rccEnableTIM16(true);
@ -1150,13 +1138,13 @@ void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) {
* @notapi
*/
void gpt_lld_serve_interrupt(GPTDriver *gptp) {
uint32_t sr;
gptp->tim->SR = 0;
if (gptp->state == GPT_ONESHOT) {
gptp->state = GPT_READY; /* Back in GPT_READY state. */
gpt_lld_stop_timer(gptp); /* Timer automatically stopped. */
sr = gptp->tim->SR;
sr &= gptp->tim->DIER & STM32_TIM_DIER_IRQ_MASK;
if ((sr & STM32_TIM_SR_UIF) != 0) {
_gpt_isr_invoke_cb(gptp);
}
gptp->config->callback(gptp);
}
#endif /* HAL_USE_GPT */

View File

@ -154,6 +154,8 @@
- HAL: Added a new interface for range-finder devices (used by EX).
- HAL: Added mcuconf.h updater tool for STM32F407 (backported to 19.1.1).
- NIL: Integrated NIL 4.0.
- FIX: Fixed Sharing issues with GPT TIMv1 driver (bug #1067)
(backported to 19.1.4)(backported to 18.2.3).
- FIX: Fixed incorrect pointer type in lwipthread.c low_level_input causes
panic on packet reception (bug #1009)
(backported to 19.1.4)(backported to 18.2.3).