static void avr_ioport_write(struct avr_t * avr, avr_io_addr_t addr, uint8_t v, void * param)
{
avr_ioport_t * p = (avr_ioport_t *)param;
- uint8_t oldv = avr->data[addr];
avr_core_watch_write(avr, addr, v);
- if (v != oldv) {
- // printf("PORT%c(%02x) = %02x (was %02x)\n", p->name, addr, v, oldv);
- int mask = v ^ oldv;
-
- // raise the internal IRQ callbacks
- for (int i = 0; i < 8; i++)
- if (mask & (1 << i))
- avr_raise_irq(p->io.irq + i, (v >> i) & 1);
- avr_raise_irq(p->io.irq + IOPORT_IRQ_PIN_ALL, v);
- }
+ // printf("PORT%c(%02x) = %02x (was %02x)\n", p->name, addr, v, oldv);
+
+ // raise the internal IRQ callbacks
+ for (int i = 0; i < 8; i++)
+ avr_raise_irq(p->io.irq + i, (v >> i) & 1);
+ avr_raise_irq(p->io.irq + IOPORT_IRQ_PIN_ALL, v);
}
/*
// allocate this module's IRQ
avr_io_setirqs(&p->io, AVR_IOCTL_IOPORT_GETIRQ(p->name), IOPORT_IRQ_COUNT, NULL);
+ for (int i = 0; i < IOPORT_IRQ_COUNT; i++)
+ p->io.irq[i].flags |= IRQ_FLAG_FILTERED;
+
avr_register_io_write(avr, p->r_port, avr_ioport_write, p);
avr_register_io_read(avr, p->r_pin, avr_ioport_read, p);
avr_register_io_write(avr, p->r_pin, avr_ioport_pin_write, p);