diff options
author | cpldcpu <cpldcpu@gmail.com> | 2014-01-05 14:57:58 +0100 |
---|---|---|
committer | cpldcpu <cpldcpu@gmail.com> | 2014-01-05 14:57:58 +0100 |
commit | 4f96c4048389d6be8df8143b3a29d877f75b5860 (patch) | |
tree | 52b5fd570f2eb36d0977120ca4f34ffefd127daa /commandline | |
parent | 2b63296c16739cb720f3c6990b5516ca43ed9851 (diff) | |
download | micronucleus-4f96c4048389d6be8df8143b3a29d877f75b5860.tar.gz micronucleus-4f96c4048389d6be8df8143b3a29d877f75b5860.tar.bz2 micronucleus-4f96c4048389d6be8df8143b3a29d877f75b5860.zip |
commandline: change usb requests to "out" if no data is requested
zero sized "In" requests require more handshaking, but do not add more
error checking or more security.
Diffstat (limited to 'commandline')
-rwxr-xr-x | commandline/builds/Windows/micronucleus.exe | bin | 26126 -> 26126 bytes | |||
-rw-r--r-- | commandline/library/micronucleus_lib.c | 6 |
2 files changed, 3 insertions, 3 deletions
diff --git a/commandline/builds/Windows/micronucleus.exe b/commandline/builds/Windows/micronucleus.exe Binary files differindex 7baaf03..4d5e212 100755 --- a/commandline/builds/Windows/micronucleus.exe +++ b/commandline/builds/Windows/micronucleus.exe diff --git a/commandline/library/micronucleus_lib.c b/commandline/library/micronucleus_lib.c index ddcefdd..eaeaf38 100644 --- a/commandline/library/micronucleus_lib.c +++ b/commandline/library/micronucleus_lib.c @@ -62,7 +62,7 @@ micronucleus* micronucleus_connect() { // get nucleus info unsigned char buffer[4]; - int res = usb_control_msg(nucleus->device, 0xC0, 0, 0, 0, (char *)buffer, 4, MICRONUCLEUS_USB_TIMEOUT); + int res = usb_control_msg(nucleus->device, USB_ENDPOINT_IN| USB_TYPE_VENDOR | USB_RECIP_DEVICE, 0, 0, 0, (char *)buffer, 4, MICRONUCLEUS_USB_TIMEOUT); assert(res >= 4); nucleus->flash_size = (buffer[0]<<8) + buffer[1]; @@ -80,7 +80,7 @@ micronucleus* micronucleus_connect() { int micronucleus_eraseFlash(micronucleus* deviceHandle, micronucleus_callback progress) { int res; - res = usb_control_msg(deviceHandle->device, 0xC0, 2, 0, 0, NULL, 0, MICRONUCLEUS_USB_TIMEOUT); + res = usb_control_msg(deviceHandle->device, USB_ENDPOINT_OUT| USB_TYPE_VENDOR | USB_RECIP_DEVICE, 2, 0, 0, NULL, 0, MICRONUCLEUS_USB_TIMEOUT); // give microcontroller enough time to erase all writable pages and come back online float i = 0; @@ -174,7 +174,7 @@ int micronucleus_writeFlash(micronucleus* deviceHandle, unsigned int program_siz int micronucleus_startApp(micronucleus* deviceHandle) { int res; - res = usb_control_msg(deviceHandle->device, 0xC0, 4, 0, 0, NULL, 0, MICRONUCLEUS_USB_TIMEOUT); + res = usb_control_msg(deviceHandle->device, USB_ENDPOINT_OUT| USB_TYPE_VENDOR | USB_RECIP_DEVICE, 4, 0, 0, NULL, 0, MICRONUCLEUS_USB_TIMEOUT); if(res!=0) return -1; |