xmos / lib_device_control

xCORE device control library
Other
2 stars 16 forks source link

change usb access to print error name instead of code #35

Closed xmosbrendon closed 7 years ago

xmosbrendon commented 7 years ago

Change to the usb access functions to print out an error name rather than the error code when libusb returns an error

larry-xmos commented 7 years ago

One too many closing brackets on lines 123 and 158 - could you amend please?

larry-xmos commented 7 years ago

Already corrected in 651df4b4

larry-xmos commented 7 years ago

Reopen - needs to use usb_strerror on Windows

larry-xmos commented 7 years ago

Could do:

#if defined _WIN32
    printf("libusb_control_transfer returned %s\n", usb_strerror());
#elif defined __APPLE__
    printf("libusb_control_transfer returned %s\n", libusb_error_name(ret));
#elif defined __linux
    printf("libusb_control_transfer returned %d\n", ret);
#endif
xmosbrendon commented 7 years ago

implemented changes. New PR opened #38