FreeCalypso > hg > fc-usbser-tools
comparison libuwrap/prelim_init.c @ 9:ab506f6aa57c
libuwrap started
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 07 Sep 2023 04:00:56 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
8:1415508e7ea2 | 9:ab506f6aa57c |
---|---|
1 /* | |
2 * libftdi-0.20 performs these preliminary steps just before it goes | |
3 * looking for the device of interest via usb_get_busses() followed | |
4 * by traversal of the returned tree - hence we do likewise. | |
5 */ | |
6 | |
7 #include <stdio.h> | |
8 #include <stdlib.h> | |
9 #include <usb.h> | |
10 #include "prelim_init.h" | |
11 | |
12 void libusb_prelim_init(void) | |
13 { | |
14 usb_init(); | |
15 if (usb_find_busses() < 0) { | |
16 fprintf(stderr, "error: usb_find_busses() failed\n"); | |
17 exit(1); | |
18 } | |
19 if (usb_find_devices() < 0) { | |
20 fprintf(stderr, "error: usb_find_devices() failed\n"); | |
21 exit(1); | |
22 } | |
23 } |