Use the saved flags for intr reset. Do not erase possible other interrupt sources.
authorNathael Pajani <nathael.pajani@ed3l.fr>
Wed, 22 Jul 2015 00:45:05 +0000 (02:45 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:04 +0000 (17:03 +0100)
drivers/timers.c

index caf7e96..bf4529a 100644 (file)
@@ -57,7 +57,7 @@ void TIMER_Handler(struct timer_device* timer)
        uint32_t intr_flags = regs->int_reg; /* Backup the flags */
 
        /* Clear the interrupt */
-       regs->int_reg = 0xFF;
+       regs->int_reg = intr_flags;
        /* And call the user routine if one has been registered */
        if (timer->callback != NULL) {
                timer->callback(intr_flags);