Manual DFU related updates from sc_usb_audio

This commit is contained in:
xross
2017-11-01 11:01:12 +00:00
parent d14275e9e4
commit c9d6ca1f9d
10 changed files with 2030 additions and 15 deletions

View File

@@ -1,2 +0,0 @@
all:
g++ -g -o xmosdfu xmosdfu.cpp -Ilibusb/OSX libusb/OSX/libusb-1.0.0.dylib -m32 -Wall

View File

@@ -0,0 +1,2 @@
all:
g++ -g -o xmosdfu xmosdfu.cpp -Ilibusb/OSX32 libusb/OSX32/libusb-1.0.0.dylib -m32 -Wall

View File

@@ -0,0 +1,2 @@
all:
g++ -g -o xmosdfu xmosdfu.cpp -Ilibusb/OSX64 libusb/OSX64/libusb-1.0.0.dylib -Wall

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -12,8 +12,21 @@ function usage {
#find out were we are running from so we only exec this programs
PROGDIR=`dirname $0`
if echo $OSTYPE | grep -q darwin ; then
platform=OSX64
elif echo $OSTYPE | grep -q abihf ; then
platform=Rasp
elif arch | grep -q x86_64 ; then
platform=Linux64
elif echo $OSTYPE | grep -q linux ; then
platform=Linux32
else
echo "Unknown OS $OSTYPE"
exit 1
fi
#setup environment
export DYLD_LIBRARY_PATH=$PROGDIR:$DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$PROGDIR/libusb/$platform:$DYLD_LIBRARY_PATH
if [ "$1" != "" ]; then
device_pid=$1

View File

@@ -87,7 +87,10 @@ static int find_xmos_device(unsigned int id, unsigned int pid, unsigned int list
else
{
struct libusb_config_descriptor *config_desc = NULL;
libusb_get_active_config_descriptor(dev, &config_desc);
int ret = libusb_get_active_config_descriptor(dev, &config_desc);
if (ret != 0) {
return -1;
}
if (config_desc != NULL)
{
//printf("bNumInterfaces: %d\n", config_desc->bNumInterfaces);
@@ -97,7 +100,7 @@ static int find_xmos_device(unsigned int id, unsigned int pid, unsigned int list
const struct libusb_interface_descriptor *inter_desc = ((struct libusb_interface *)&config_desc->interface[j])->altsetting;
if (inter_desc->bInterfaceClass == 0xFE && inter_desc->bInterfaceSubClass == 0x1)
{
XMOS_DFU_IF = j;
XMOS_DFU_IF = inter_desc->bInterfaceNumber;
}
}
}
@@ -372,11 +375,6 @@ static unsigned int select_pid(char *device_pid)
int main(int argc, char **argv)
{
unsigned char dfuState = 0;
unsigned char nextDfuState = 0;
unsigned int timeout = 0;
unsigned char strIndex = 0;
unsigned int download = 0;
unsigned int upload = 0;
unsigned int revert = 0;