xcpt_t board_button_irq(int id, xcpt_t irqhandler) { #ifdef HAVE_IRQBUTTONS switch (id) { #ifdef CONFIG_SAMV7_GPIOA_IRQ case BUTTON_SW0: return board_button_irqx(GPIO_SW0, IRQ_SW0, irqhandler, &g_irq_sw0); #endif #ifdef CONFIG_SAMV7_GPIOB_IRQ case BUTTON_SW1: return board_button_irqx(GPIO_SW1, IRQ_SW1, irqhandler, &g_irq_sw1); #endif default: return NULL; } #else return NULL; #endif }
xcpt_t board_button_irq(int id, xcpt_t irqhandler) { if (id == BUTTON1) { return board_button_irqx(IRQ_BUTTON1, irqhandler, &g_irqbutton1); } else if (id == BUTTON2) { return board_button_irqx(IRQ_BUTTON2, irqhandler, &g_irqbutton2); } else { return NULL; } }
xcpt_t board_button_irq(int id, xcpt_t irqhandler) { switch (id) { case BUTTON_SCROLLUP: return board_button_irqx(GPIO_SCROLLUP, IRQ_SCROLLUP, irqhandler, &g_irq_scrollup); case BUTTON_SCROLLDOWN: return board_button_irqx(GPIO_SCROLLDWN, IRQ_SCROLLDWN, irqhandler, &g_irq_scrolldown); case BUTTON_WAKU: return board_button_irqx(GPIO_WAKU, IRQ_WAKU, irqhandler, &g_irq_waku); case BUTTON_TAMP: return board_button_irqx(GPIO_TAMP, IRQ_TAMP, irqhandler, &g_irq_tamp); default: return NULL; } }