1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Add an ability to handle multiple DFU device types

This commit is contained in:
jflyper 2018-11-12 20:27:11 +09:00
parent 1fbf411b5a
commit 2f2da42f53
3 changed files with 8 additions and 6 deletions

View file

@ -1,8 +1,9 @@
'use strict';
var usbDevices = {
STM32DFU: {'vendorId': 1155, 'productId': 57105}
};
var usbDevices = { filters: [
{'vendorId': 1155, 'productId': 57105},
{'vendorId': 10473, 'productId': 393}
] };
var PortHandler = new function () {
this.initial_ports = false;
@ -146,7 +147,7 @@ PortHandler.check = function () {
};
PortHandler.check_usb_devices = function (callback) {
chrome.usb.getDevices(usbDevices.STM32DFU, function (result) {
chrome.usb.getDevices(usbDevices, function (result) {
if (result.length) {
if (!$("div#port-picker #port [value='DFU']").length) {
$('div#port-picker #port').append($('<option/>', {value: "DFU", text: "DFU", data: {isDFU: true}}));