Skip to content

Commit

Permalink
Fix flashing under linux
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorcomander committed Feb 8, 2018
1 parent 095f285 commit 1569e1f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
13 changes: 11 additions & 2 deletions content/flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var usbDevices = {
}
};


var dfuDetector = true;
var firmwares = [];
var firmwareMap = {};

Expand All @@ -29,6 +31,7 @@ CONTENT.flasher.initialize = function(callback) {
});

function checkDFU() {
if (dfuDetector) {
chrome.usb.getDevices(usbDevices.STM32DFU, function(result) {
if (result.length == 0) {
$("#portArea").children().removeClass('flashing-in-progress');
Expand All @@ -41,10 +44,14 @@ CONTENT.flasher.initialize = function(callback) {
if (GUI.activeContent == 'flasher')
setTimeout(checkDFU, 2000);
}
});
});
} else {
setTimeout(checkDFU, 2000);
}
}

function htmlLoaded() {
dfuDetector=true;
$("#portArea").children().addClass('flashing-in-progress');
$("a.navigation-menu-button").hide();
$("#navigation").hide();
Expand Down Expand Up @@ -202,7 +209,8 @@ CONTENT.flasher.initialize = function(callback) {
$("#download_url").addClass('disabled');

$("#status").html("Removing device protection");
self.success = false;
dfuDetector = false;
self.success = false;
STM32DFU.connect(usbDevices.STM32DFU, self.parsed_hex, {
read_unprotect : true,
event_handler : function(event) {
Expand All @@ -226,6 +234,7 @@ CONTENT.flasher.initialize = function(callback) {
}
}
}, function() {
dfuDetector = true;
$("#flash").removeClass('disabled');
$("#select_file").removeClass('disabled');
$("#download_file").removeClass('disabled');
Expand Down
2 changes: 1 addition & 1 deletion content/welcome.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="welcome">
<h4><span data-i18n="title.kiss"></span> v2.0.1</h4>
<h4><span data-i18n="title.kiss"></span> v2.0.2</h4>
<br />
<p data-i18n="text.connect"></p>
<p>
Expand Down
7 changes: 6 additions & 1 deletion content/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONTENT.welcome.initialize = function(callback) {
}

function checkDFU() {
if (dfuDetector) {
chrome.usb.getDevices(usbDevices.STM32DFU, function(result) {
if (result.length) {
GUI.contentSwitchInProgress = true;
Expand All @@ -27,9 +28,13 @@ CONTENT.welcome.initialize = function(callback) {
}
}
});
} else {
setTimeout(checkDFU, 2000);
}
}

function htmlLoaded() {
function htmlLoaded() {
dfuDetector = true;
if (canDFU()) checkDFU();

$("#language").val($.i18n.locale);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"minimum_chrome_version": "38",
"version": "2.0.1",
"version": "2.0.2",

"author": "Flyduino & Alexander Fedorov",
"name": "KissFC",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "KISS GUI",
"main": "main.html",
"version": "2.0.1",
"version": "2.0.2",
"single-instance": true,
"window": {
"title": "KISS GUI",
Expand Down

0 comments on commit 1569e1f

Please sign in to comment.