git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11422 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2018-02-02 10:15:24 +00:00
parent ba9b7671a0
commit 4f98c8cf4c
3 changed files with 13 additions and 11 deletions

View File

@ -677,10 +677,10 @@ void gpt_lld_start(GPTDriver *gptp) {
"invalid frequency");
/* Timer configuration.*/
gptp->tim->CR1 = 0; /* Initially stopped. */
gptp->tim->CR2 = gptp->config->cr2;
gptp->tim->PSC = psc; /* Prescaler value. */
gptp->tim->SR = 0; /* Clear pending IRQs. */
gptp->tim->CR1 = 0; /* Initially stopped. */
gptp->tim->CR2 = gptp->config->cr2;
gptp->tim->PSC = psc; /* Prescaler value. */
gptp->tim->SR = 0; /* Clear pending IRQs. */
gptp->tim->DIER = gptp->config->dier & /* DMA-related DIER bits. */
~STM32_TIM_DIER_IRQ_MASK;
}
@ -695,9 +695,9 @@ void gpt_lld_start(GPTDriver *gptp) {
void gpt_lld_stop(GPTDriver *gptp) {
if (gptp->state == GPT_READY) {
gptp->tim->CR1 = 0; /* Timer disabled. */
gptp->tim->CR1 = 0; /* Timer disabled. */
gptp->tim->DIER = 0; /* All IRQs disabled. */
gptp->tim->SR = 0; /* Clear pending IRQs. */
gptp->tim->SR = 0; /* Clear pending IRQs. */
#if STM32_GPT_USE_TIM1
if (&GPTD1 == gptp) {
@ -819,7 +819,7 @@ void gpt_lld_stop(GPTDriver *gptp) {
*/
void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval) {
gptp->tim->ARR = (uint32_t)(interval); /* Time constant. */
gptp->tim->ARR = (uint32_t)interval; /* Time constant. */
gptp->tim->EGR = STM32_TIM_EGR_UG; /* Update event. */
gptp->tim->CNT = 0; /* Reset counter. */
@ -861,7 +861,7 @@ void gpt_lld_stop_timer(GPTDriver *gptp) {
*/
void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) {
gptp->tim->ARR = (uint32_t)(interval); /* Time constant. */
gptp->tim->ARR = (uint32_t)interval; /* Time constant. */
gptp->tim->EGR = STM32_TIM_EGR_UG; /* Update event. */
gptp->tim->SR = 0; /* Clear pending IRQs. */
gptp->tim->CR1 = STM32_TIM_CR1_OPM | STM32_TIM_CR1_URS | STM32_TIM_CR1_CEN;

View File

@ -541,8 +541,8 @@ struct GPTDriver {
*
* @notapi
*/
#define gpt_lld_change_interval(gptp, interval) \
((gptp)->tim->ARR = (uint32_t)((interval) - 1))
#define gpt_lld_change_interval(gptp, interval) \
((gptp)->tim->ARR = (uint32_t)(interval))
/**
* @brief Returns the interval of GPT peripheral.
@ -553,7 +553,7 @@ struct GPTDriver {
*
* @notapi
*/
#define gpt_lld_get_interval(gptp) ((gptcnt_t)(gptp)->tim->ARR + 1)
#define gpt_lld_get_interval(gptp) ((gptcnt_t)(gptp)->tim->ARR)
/**
* @brief Returns the counter value of GPT peripheral.

View File

@ -166,6 +166,8 @@
dependencies and configuration directories. This makes possible
to have multiple non-conflicting makefiles in the same project.
Updated the various platform.mk implementing "smart build" mode.
- HAL: Fixed more instances of bug #843 (bug #914)(backported to 17.6.4
and 16.1.10).
- HAL: Fixed Clock selection for SDMMC2 missing in STM32F7 HAL (bug #913).
- HAL: Fixed STM32 SDMMCv1 driver not setting DMA channel properly for SDCD2
instance (bug #912)(backported to 17.6.4).