stm32/stm32f7 tickless: Fix clearing and checking of interrupts.

This commit is contained in:
Anthony Merlino 2021-04-10 20:04:00 -04:00 committed by Xiang Xiao
parent dd00c6427e
commit f979dd72c1
3 changed files with 7 additions and 7 deletions

View File

@ -583,7 +583,7 @@ void up_timer_initialize(void)
/* Start the timer */
STM32_TIM_ACKINT(g_tickless.tch, GTIM_SR_UIF);
STM32_TIM_ACKINT(g_tickless.tch, ~0);
STM32_TIM_ENABLEINT(g_tickless.tch, GTIM_DIER_UIE);
}
@ -644,7 +644,7 @@ int up_timer_gettime(FAR struct timespec *ts)
overflow = g_tickless.overflow;
counter = STM32_TIM_GETCOUNTER(g_tickless.tch);
pending = STM32_TIM_CHECKINT(g_tickless.tch, 0);
pending = STM32_TIM_CHECKINT(g_tickless.tch, GTIM_SR_UIF);
verify = STM32_TIM_GETCOUNTER(g_tickless.tch);
/* If an interrupt was pending before we re-enabled interrupts,

View File

@ -356,7 +356,7 @@ static void stm32_timing_handler(void)
{
g_tickless.overflow++;
STM32_TIM_ACKINT(g_tickless.tch, 0);
STM32_TIM_ACKINT(g_tickless.tch, ATIM_SR_UIF);
}
#endif /* CONFIG_CLOCK_TIMEKEEPING */
@ -627,7 +627,7 @@ void up_timer_initialize(void)
/* Start the timer */
STM32_TIM_ACKINT(g_tickless.tch, 0);
STM32_TIM_ACKINT(g_tickless.tch, ~0);
STM32_TIM_ENABLEINT(g_tickless.tch, 0);
}
@ -696,7 +696,7 @@ int up_timer_gettime(FAR struct timespec *ts)
overflow = g_tickless.overflow;
counter = STM32_TIM_GETCOUNTER(g_tickless.tch);
pending = STM32_TIM_CHECKINT(g_tickless.tch, 0);
pending = STM32_TIM_CHECKINT(g_tickless.tch, ATIM_SR_UIF);
verify = STM32_TIM_GETCOUNTER(g_tickless.tch);
/* If an interrupt was pending before we re-enabled interrupts,
@ -705,7 +705,7 @@ int up_timer_gettime(FAR struct timespec *ts)
if (pending)
{
STM32_TIM_ACKINT(g_tickless.tch, 0);
STM32_TIM_ACKINT(g_tickless.tch, ATIM_SR_UIF);
/* Increment the overflow count and use the value of the
* guaranteed to be AFTER the overflow occurred.

View File

@ -660,7 +660,7 @@ static int stm32_tim_checkint(FAR struct stm32_tim_dev_s *dev, int source)
static void stm32_tim_ackint(FAR struct stm32_tim_dev_s *dev, int source)
{
stm32_putreg16(dev, STM32_BTIM_SR_OFFSET, ~ATIM_SR_UIF);
stm32_putreg16(dev, STM32_BTIM_SR_OFFSET, ~source);
}
/****************************************************************************