MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / usb_init_device

Function usb_init_device

core/usb/usb.c:163–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163int usb_init_device(int argc, const char *const *argv,
164 usb_progress_handler_t *progress_handler, void *progress_context) {
165 if (!usb.device) {
166 usb.device = usb_disconnected_device;
167 }
168 usb.event.type = USB_DESTROY_EVENT;
169 usb.device(&usb.event);
170 usb.event.type = USB_INIT_EVENT;
171 usb_init_info_t *init = &usb.event.info.init;
172 init->argc = argc;
173 init->argv = argv;
174 if (argc < 1) {
175 usb.device = usb_disconnected_device;
176 } else if (!strcasecmp(argv[0], "dusb")) {
177 usb.device = usb_dusb_device;
178 } else {
179 return ENOEXEC;
180 }
181 usb.event.progress_handler = progress_handler;
182 usb.event.progress_context = progress_context;
183 int error = usb_dispatch_event();
184 if (!error) {
185 usb_plug();
186 }
187 return error;
188}
189
190static void usb_event(enum sched_item_id event) {
191 (void)event;

Callers 3

emu_send_variablesFunction · 0.85
emu_cancel_transferFunction · 0.85
asic_freeFunction · 0.85

Calls 2

usb_dispatch_eventFunction · 0.85
usb_plugFunction · 0.85

Tested by

no test coverage detected