// Interrupt on "pin change" from PB0 to do wakeup on USB // Note: // This interrupt is enable when the USB host enable remotewakeup feature // This interrupt wakeup the CPU if this one is in idle mode static void UI_WAKEUP_HANDLER(void) { sysclk_enable_peripheral_clock(EIC); if(eic_line_interrupt_is_pending(EIC, UI_WAKEUP_EIC_LINE)) { eic_line_clear_interrupt(EIC, UI_WAKEUP_EIC_LINE); ui_disable_asynchronous_interrupt(); // It is a wakeup then send wakeup USB udc_remotewakeup(); } sysclk_disable_peripheral_clock(EIC); }
/** * \brief External interrupt handler, used by PB0 push button */ static void eic5_callback(void) { sysclk_enable_peripheral_clock(EIC); if(eic_line_interrupt_is_pending(EIC,GPIO_PUSH_BUTTON_EIC_LINE)) { eic_line_clear_interrupt(EIC,GPIO_PUSH_BUTTON_EIC_LINE); event_pbEvent = true; } sysclk_disable_peripheral_clock(EIC); }
// Interrupt on "pin change" from SW0 to do wakeup on USB // Note: // This interrupt is enable when the USB host enable remotewakeup feature // This interrupt wakeup the CPU if this one is in idle mode static void UI_WAKEUP_HANDLER(void) { sysclk_enable_peripheral_clock(EIC); if(eic_line_interrupt_is_pending(EIC, UI_WAKEUP_EIC_LINE)) { eic_line_clear_interrupt(EIC, UI_WAKEUP_EIC_LINE); ui_disable_asynchronous_interrupt(); // It is a wakeup then send wakeup USB udc_remotewakeup(); // Wakeup, ignore button change until button is back to default state btn_wakeup = true; } sysclk_disable_peripheral_clock(EIC); }
/** * \brief Interrupt handler for interrupt pin change */ static void UI_WAKEUP_HANDLER(void) { sysclk_enable_peripheral_clock(EIC); if (eic_line_interrupt_is_pending(EIC, UI_WAKEUP_EIC_LINE)) { eic_line_clear_interrupt(EIC, UI_WAKEUP_EIC_LINE); if (uhc_is_suspend()) { ui_disable_asynchronous_interrupt(); /* Wakeup host and device */ uhc_resume(); } } sysclk_disable_peripheral_clock(EIC); }
/** * \brief Interrupt handler for interrupt pin change */ static void UI_WAKEUP_HANDLER(void) { sysclk_enable_peripheral_clock(EIC); if (eic_line_interrupt_is_pending(EIC, UI_WAKEUP_EIC_LINE)) { eic_line_clear_interrupt(EIC, UI_WAKEUP_EIC_LINE); if (ui_b_host_mode) { if (!uhc_is_suspend()) { /* USB is not in suspend mode * Let's interrupt enable. */ return; } ui_disable_asynchronous_interrupt(); /* Wakeup the devices connected */ uhc_resume(); } else { /* In device mode, wakeup the USB host. */ udc_remotewakeup(); } } sysclk_disable_peripheral_clock(EIC); }
/** * \brief EIC interrupt handler for push button interrupt */ static void eic_5_callback(void) { if (eic_line_interrupt_is_pending(EIC, GPIO_PUSH_BUTTON_EIC_LINE)) { eic_line_clear_interrupt(EIC, GPIO_PUSH_BUTTON_EIC_LINE); } }