1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-15 20:35:23 +03:00

Work around false error when claiming interface to fix firmware flasing on MacOS

The error check after attempting to claim the USB interface was falsely indicating failure on MacOS even though it was working properly. Tried all available versions of NW.js (including beta) and none resolve the problem. The problem only seems to affect MacOS.

The error check after claiming the interface is suppressed for MacOS to work around the problem. Risk is low because even if the climing of the interface failed the worst that could happen is flash fails anyway.

Hopefully there will be some future version of NW.js that resolves the problem and we can remove this workaround later (tested through 0.45.0-beta1 so far).
This commit is contained in:
Bruce Luckcuck 2020-03-11 08:59:39 -04:00
parent 233a992f57
commit 42f5acd26f

View file

@ -156,7 +156,10 @@ STM32DFU_protocol.prototype.claimInterface = function (interfaceNumber) {
var self = this;
chrome.usb.claimInterface(this.handle, interfaceNumber, function claimed() {
if(self.checkChromeError()) {
// Don't perform the error check on MacOS at this time as there seems to be a bug
// where it always reports the Chrome error "Error claiming interface." even though
// the interface is in fact successfully claimed.
if (self.checkChromeError() && (GUI.operating_system !== "MacOS")) {
console.log('Failed to claim USB device!');
self.cleanup();
}