/** * USB ID pin change handler */ static void usb_id_handler(void) { extint_chan_disable_callback(USB_ID_EIC_LINE, EXTINT_CALLBACK_TYPE_DETECT); if (_usb_is_id_device()) { uhc_stop(false); UHC_MODE_CHANGE(false); udc_start(); } else { udc_stop(); UHC_MODE_CHANGE(true); uhc_start(); } extint_chan_enable_callback(USB_ID_EIC_LINE, EXTINT_CALLBACK_TYPE_DETECT); }
static void run_test_stop_uhc(const struct test_case *test) { // Stop USB host stack uhc_stop(true); test_assert_true(test, main_events == 0, "A USB event has been received after USB stack stop"); }