Fix windows issues.

This commit is contained in:
Serge Vakulenko 2018-09-18 04:59:46 -07:00
parent f6dd16d0c2
commit e09c4d3b6e
2 changed files with 4 additions and 2 deletions

View File

@ -530,6 +530,8 @@ void dfu_reboot()
{ {
unsigned char cmd[2] = { 0x91, 0x05 }; unsigned char cmd[2] = { 0x91, 0x05 };
if (!dev)
return;
if (trace_flag) { if (trace_flag) {
printf("--- Send DNLOAD [2] "); printf("--- Send DNLOAD [2] ");
print_hex(cmd, 2); print_hex(cmd, 2);

View File

@ -154,7 +154,7 @@ HANDLE find_hid_device(int vid, int pid)
printf("Device %d: cannot get path!\n", index); printf("Device %d: cannot get path!\n", index);
continue; continue;
} }
printf("Device %d: path %s\n", index, detail->DevicePath); //printf("Device %d: path %s\n", index, detail->DevicePath);
h = CreateFile(detail->DevicePath, GENERIC_WRITE | GENERIC_READ, h = CreateFile(detail->DevicePath, GENERIC_WRITE | GENERIC_READ,
0, NULL, OPEN_EXISTING, 0, NULL); 0, NULL, OPEN_EXISTING, 0, NULL);
@ -166,7 +166,7 @@ HANDLE find_hid_device(int vid, int pid)
HIDD_ATTRIBUTES attrib; HIDD_ATTRIBUTES attrib;
attrib.Size = sizeof(HIDD_ATTRIBUTES); attrib.Size = sizeof(HIDD_ATTRIBUTES);
HidD_GetAttributes(h, &attrib); HidD_GetAttributes(h, &attrib);
printf("Product/Vendor: %x %x\n", attrib.ProductID, attrib.VendorID); //printf("Vendor/Product: %04x %04x\n", attrib.VendorID, attrib.ProductID);
// Check the VID/PID. // Check the VID/PID.
if (attrib.VendorID != vid || attrib.ProductID != pid) { if (attrib.VendorID != vid || attrib.ProductID != pid) {