From 14d1c0ae13a659f049bf5907eaaeb6a6c40af27a Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Sat, 10 Apr 2010 11:35:32 +0100 Subject: [PATCH] ioport: No longer need pcint to change the value IRQ callback changes the AVR memory even if the pcint is not present. Signed-off-by: Michel Pollet --- simavr/sim/avr_ioport.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/simavr/sim/avr_ioport.c b/simavr/sim/avr_ioport.c index f9af634..32cf5f9 100644 --- a/simavr/sim/avr_ioport.c +++ b/simavr/sim/avr_ioport.c @@ -69,13 +69,12 @@ void avr_ioport_irq_notify(struct avr_irq_t * irq, uint32_t value, void * param) avr_ioport_t * p = (avr_ioport_t *)param; avr_t * avr = p->io.avr; - // printf("pcint port%c pcint %02x:%02x\n", p->name, p->r_pcint, avr->data[p->r_pcint]); - if (p->r_pcint) { - uint8_t mask = 1 << irq->irq; + uint8_t mask = 1 << irq->irq; // set the real PIN bit. ddr doesn't matter here as it's masked when read. - avr->data[p->r_pin] &= ~mask; - if (value) - avr->data[p->r_pin] |= mask; + avr->data[p->r_pin] &= ~mask; + if (value) + avr->data[p->r_pin] |= mask; + if (p->r_pcint) { // if the pcint bit is on, try to raise it int raise = avr->data[p->r_pcint] & mask; if (raise) -- 2.39.5