static void avr_deallocate_io( avr_io_t * io) { if (io->dealloc) io->dealloc(io); avr_free_irq(io->irq, io->irq_count); io->irq_count = 0; io->irq_ioctl_get = 0; io->avr = NULL; io->next = NULL; }
void LedButtonsLogic::unwireHook() { const int count = strlen(ports) * 8; for (int i = 0; i < count; i++) { int port = i / 8; int pin = i % 8; avr_irq_unregister_notify(avr_io_getirq(avr, AVR_IOCTL_IOPORT_GETIRQ(ports[port]), pin), LedButtonsLogic::pinChanged, callbackData[i]); delete callbackData[i]; } callbackData.clear(); avr_free_irq(irq, count); avr_vcd_close(&vcdFile); irq = NULL; }
void LcdLogic::unwireHook() { for (int i = 0; i < 4; i++) { avr_irq_t * iavr = avr_io_getirq(avr, AVR_IOCTL_IOPORT_GETIRQ('C'), 4 + i); avr_irq_t * ilcd = hd44780.irq + IRQ_HD44780_D4 + i; avr_unconnect_irq(iavr, ilcd); avr_unconnect_irq(ilcd, iavr); } avr_unconnect_irq(avr_io_getirq(avr, AVR_IOCTL_IOPORT_GETIRQ('C'), 2), hd44780.irq + IRQ_HD44780_RS); avr_unconnect_irq(avr_io_getirq(avr, AVR_IOCTL_IOPORT_GETIRQ('C'), 3), hd44780.irq + IRQ_HD44780_E); avr_free_irq(hd44780.irq, IRQ_HD44780_COUNT); avr_vcd_close(&vcdFile); }