|
20 | 20 | * *
|
21 | 21 | * _____________ *
|
22 | 22 | * | |____JTAG/SWD (TDO,TDI,TMS,TCK,TRST) *
|
23 |
| - * USB__| CH347T | * |
| 23 | + * USB__| CH347T/F | * |
24 | 24 | * |_____________|____UART(TXD1,RXD1,RTS1,CTS1,DTR1) *
|
25 | 25 | * ______|______ *
|
26 | 26 | * | | *
|
@@ -234,8 +234,8 @@ bool ugOpen;
|
234 | 234 | unsigned long ugIndex;
|
235 | 235 | struct libusb_device_handle *ch347_handle;
|
236 | 236 |
|
237 |
| -static const uint16_t ch347_vids[] = {0x1a86, 0}; |
238 |
| -static const uint16_t ch347_pids[] = {0x55dd, 0}; |
| 237 | +static const uint16_t ch347_vids[] = {0x1a86, 0x1a86}; |
| 238 | +static const uint16_t ch347_pids[] = {0x55dd, 0x55de}; |
239 | 239 |
|
240 | 240 | static uint32_t CH347OpenDevice(uint64_t iIndex)
|
241 | 241 | {
|
@@ -933,7 +933,7 @@ static void CH347_WriteRead(struct scan_command *cmd, uint8_t *bits,
|
933 | 933 | bit_count += cmd->fields[i].num_bits;
|
934 | 934 | if (ch347.pack_size == LARGER_PACK) {
|
935 | 935 | if (num_bits > 7)
|
936 |
| - ch347.read_idx += DIV_ROUND_UP(bit_count, 8); |
| 936 | + ch347.read_idx += DIV_ROUND_UP(bit_count, 8); |
937 | 937 | offset += num_bits;
|
938 | 938 | }
|
939 | 939 | }
|
@@ -1102,11 +1102,12 @@ static int ch347_init(void)
|
1102 | 1102 | }
|
1103 | 1103 | }
|
1104 | 1104 | DevIsOpened = CH347OpenDevice(ugIndex);
|
| 1105 | + if (DevIsOpened == -1) { |
1105 | 1106 | #elif defined(__linux__)
|
1106 | 1107 | DevIsOpened = CH347OpenDevice(ugIndex);
|
1107 | 1108 | ugIndex = DevIsOpened;
|
| 1109 | + if (DevIsOpened == false) { |
1108 | 1110 | #endif
|
1109 |
| - if (DevIsOpened == -1) { |
1110 | 1111 | LOG_ERROR("CH347 Open Error.");
|
1111 | 1112 | return ERROR_FAIL;
|
1112 | 1113 | } else {
|
|
0 commit comments