Skip to content

Commit 03009a1

Browse files
committed
pbio/drv/clock/clock_ev3: Clear the correct interrupt flag
The interrupt enable and interrupt status bits are not the same. There is no need to disable and re-enable the interrupt if clearing the correct bit.
1 parent 52228aa commit 03009a1

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/pbio/drv/clock/clock_ev3.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,14 @@ volatile uint32_t systick_ms = 0;
4141
* The systick interrupt service routine (ISR) which will be called every millisecond.
4242
*/
4343
void systick_isr_C(void) {
44-
/* Disable the timer interrupt */
45-
TimerIntDisable(SOC_TMR_0_REGS, TMR_INT_TMR34_NON_CAPT_MODE);
46-
4744
/* Clear the interrupt status in AINTC and in timer */
4845
IntSystemStatusClear(SYS_INT_TINT34_0);
49-
TimerIntStatusClear(SOC_TMR_0_REGS, TMR_INT_TMR34_NON_CAPT_MODE);
46+
TimerIntStatusClear(SOC_TMR_0_REGS, TMR_INTSTAT34_TIMER_NON_CAPT);
5047

5148
++systick_ms;
5249

5350
etimer_request_poll();
5451
pbio_os_request_poll();
55-
56-
/* Enable the timer interrupt */
57-
TimerIntEnable(SOC_TMR_0_REGS, TMR_INT_TMR34_NON_CAPT_MODE);
5852
}
5953

6054
/**

0 commit comments

Comments
 (0)