Esempio n. 1
0
File: ui.c Progetto: Mazetti/asf
/* Interrupt on "pin change" from RIGHT CLICK 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(uint32_t id, uint32_t mask)
{
	if (RESUME_PIO_ID == id && RESUME_PIO_MASK == mask) {
		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 */
			pmc_wait_wakeup_clocks_restore(uhc_resume);
		} else {
			/* In device mode, wakeup the USB host. */
			pmc_wait_wakeup_clocks_restore(udc_remotewakeup);
		}
	}
}
Esempio n. 2
0
/* Interrupt on "pin change" from RIGHT CLICK 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(uint32_t id, uint32_t mask)
{
	if (RESUME_PIO_ID == id && RESUME_PIO_MASK == mask) {
		if (uhc_is_suspend()) {
			ui_disable_asynchronous_interrupt();

			/* Wakeup host and device */
			pmc_wait_wakeup_clocks_restore(uhc_resume);
		}
	}
}