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",
|
"notifications",
|
||||||
"alwaysOnTopWindows",
|
"alwaysOnTopWindows",
|
||||||
{"usbDevices": [
|
{"usbDevices": [
|
||||||
{"vendorId": 1155, "productId": 57105}
|
{"vendorId": 1155, "productId": 57105},
|
||||||
|
{"vendorId": 10473, "productId": 393}
|
||||||
]},
|
]},
|
||||||
"webview",
|
"webview",
|
||||||
"unlimitedStorage"
|
"unlimitedStorage"
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var usbDevices = {
|
var usbDevices = { filters: [
|
||||||
STM32DFU: {'vendorId': 1155, 'productId': 57105}
|
{'vendorId': 1155, 'productId': 57105},
|
||||||
};
|
{'vendorId': 10473, 'productId': 393}
|
||||||
|
] };
|
||||||
|
|
||||||
var PortHandler = new function () {
|
var PortHandler = new function () {
|
||||||
this.initial_ports = false;
|
this.initial_ports = false;
|
||||||
|
@ -146,7 +147,7 @@ PortHandler.check = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
PortHandler.check_usb_devices = function (callback) {
|
PortHandler.check_usb_devices = function (callback) {
|
||||||
chrome.usb.getDevices(usbDevices.STM32DFU, function (result) {
|
chrome.usb.getDevices(usbDevices, function (result) {
|
||||||
if (result.length) {
|
if (result.length) {
|
||||||
if (!$("div#port-picker #port [value='DFU']").length) {
|
if (!$("div#port-picker #port [value='DFU']").length) {
|
||||||
$('div#port-picker #port').append($('<option/>', {value: "DFU", text: "DFU", data: {isDFU: true}}));
|
$('div#port-picker #port').append($('<option/>', {value: "DFU", text: "DFU", data: {isDFU: true}}));
|
||||||
|
|
|
@ -497,7 +497,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
} else {
|
} else {
|
||||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FIRMWARE, 'Flashing');
|
analytics.sendEvent(analytics.EVENT_CATEGORIES.FIRMWARE, 'Flashing');
|
||||||
|
|
||||||
STM32DFU.connect(usbDevices.STM32DFU, parsed_hex, options);
|
STM32DFU.connect(usbDevices, parsed_hex, options);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$('span.progressLabel').text(i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
|
$('span.progressLabel').text(i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue