mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 05:15:21 +03:00
Add an ability to handle multiple DFU device types
This commit is contained in:
parent
1fbf411b5a
commit
2f2da42f53
3 changed files with 8 additions and 6 deletions
|
@ -34,7 +34,8 @@
|
|||
"notifications",
|
||||
"alwaysOnTopWindows",
|
||||
{"usbDevices": [
|
||||
{"vendorId": 1155, "productId": 57105}
|
||||
{"vendorId": 1155, "productId": 57105},
|
||||
{"vendorId": 10473, "productId": 393}
|
||||
]},
|
||||
"webview",
|
||||
"unlimitedStorage"
|
||||
|
|
|
@ -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}}));
|
||||
|
|
|
@ -497,7 +497,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
} else {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FIRMWARE, 'Flashing');
|
||||
|
||||
STM32DFU.connect(usbDevices.STM32DFU, parsed_hex, options);
|
||||
STM32DFU.connect(usbDevices, parsed_hex, options);
|
||||
}
|
||||
} else {
|
||||
$('span.progressLabel').text(i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue