From 2a7aa7d853046e7b17779f4a558ddf8ef5343570 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Tue, 7 Mar 2017 18:37:42 +0000 Subject: [PATCH] IRQs: Trace the pending vectors Trace pending vectors, and use the new 'float' option when nothing is pending Signed-off-by: Michel Pollet --- simavr/sim/sim_interrupts.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/simavr/sim/sim_interrupts.c b/simavr/sim/sim_interrupts.c index 8cd0dd1..ab5fd9f 100644 --- a/simavr/sim/sim_interrupts.c +++ b/simavr/sim/sim_interrupts.c @@ -164,8 +164,11 @@ avr_clear_interrupt( vector->pending = 0; avr_raise_irq(vector->irq + AVR_INT_IRQ_PENDING, 0); - avr_raise_irq(avr->interrupts.irq + AVR_INT_IRQ_PENDING, - avr_has_pending_interrupts(avr)); + avr_raise_irq_float(avr->interrupts.irq + AVR_INT_IRQ_PENDING, + avr_has_pending_interrupts(avr) ? + avr_int_pending_read_at( + &avr->interrupts.pending, 0)->vector : 0, + !avr_has_pending_interrupts(avr)); if (vector->raised.reg && !vector->raise_sticky) avr_regbit_clear(avr, vector->raised); -- 2.39.5