Commit a3c405ddb416bbf6848c31aff73803bf45aa0cee
authorTam Do <tdo.pro@gmail.com>
Wed, 18 Jul 2018 00:27:44 +0000 (19:27 -0500)
committerTam Do <tdo.pro@gmail.com>
Wed, 18 Jul 2018 00:30:54 +0000 (19:30 -0500)
simavr/sim/sim_interrupts.c

index b689a94ea9ef75797f7bb91497bf1587ccef84f4..68c3bffe26063346ffb534321dbae89cedf7c56f 100644 (file)
@@ -114,13 +114,15 @@ avr_raise_interrupt(
 {
        if (!vector || !vector->vector)
                return 0;
+
        if (vector->pending) {
                if (vector->trace)
                        printf("IRQ%d:I=%d already raised (enabled %d) (cycle %lld pc 0x%x)\n",
                                vector->vector, !!avr->sreg[S_I], avr_regbit_get(avr, vector->enable),
                                (long long int)avr->cycle, avr->pc);
-               return 0;
+        // no return - polling ISR within interrupt allowed
        }
+
        if (vector->trace)
                printf("IRQ%d raising (enabled %d)\n",
                        vector->vector, avr_regbit_get(avr, vector->enable));