示例#1
0
static void run_test_downstream_disconnection(const struct test_case *test)
{
	uhc_suspend(false);
	delay_ms(30);
	uhc_resume();
	CHECK_EVENT_DISCONNECTION();
}
示例#2
0
static void run_test_downstream(const struct test_case *test)
{
	uhc_suspend(false);
	delay_ms(30);
	uhc_resume();
	CHECK_EVENT_WAKEUP();
}
示例#3
0
文件: ui.c 项目: zhengwang721/ASF
/**
 * \brief Interrupt handler for interrupt pin change
 */
static void UI_WAKEUP_HANDLER(void)
{
	if (uhc_is_suspend()) {
		ui_disable_asynchronous_interrupt();

		/* Wakeup host and device */
		uhc_resume();
	}
}
示例#4
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 */
			uhc_resume();
		}
	}
}
示例#5
0
文件: ui.c 项目: scarecrowli/asf
/**
 * \brief Interrupt handler for interrupt pin change
 */
static void UI_WAKEUP_HANDLER(void)
{
	if (ui_b_host_mode) {
		if (uhc_is_suspend()) {
			ui_disable_asynchronous_interrupt();

			/* Wakeup the devices connected */
			uhc_resume();
		}
	} else {
		/* In device mode, wakeup the USB host. */
		udc_remotewakeup();
	}
}
示例#6
0
文件: ui.c 项目: InSoonPark/asf
/**
 * \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);
}
示例#7
0
文件: ui.c 项目: marekr/asf
/**
 * \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);
}