mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-18 22:05:13 +03:00
Small fix for erase chip issue (F4 too much flash, and takes too long)
This commit is contained in:
parent
94a7f9daf2
commit
5dbcd02148
1 changed files with 13 additions and 5 deletions
|
@ -476,17 +476,25 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
||||||
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function (data) {
|
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function (data) {
|
||||||
if (data[4] == self.state.dfuDNBUSY) { // completely normal
|
if (data[4] == self.state.dfuDNBUSY) { // completely normal
|
||||||
var delay = data[1] | (data[2] << 8) | (data[3] << 16);
|
var delay = data[1] | (data[2] << 8) | (data[3] << 16);
|
||||||
|
var startTime = (Date.now() / 1000 | 0);
|
||||||
setTimeout(function () {
|
var check = function () {
|
||||||
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function (data) {
|
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function (data) {
|
||||||
if (data[4] == self.state.dfuDNLOAD_IDLE) {
|
if (data[4] == self.state.dfuDNLOAD_IDLE) {
|
||||||
|
self.progress_bar_e.val(100);
|
||||||
self.upload_procedure(4);
|
self.upload_procedure(4);
|
||||||
|
} else {
|
||||||
|
var currentTime = (Date.now() / 1000 | 0);
|
||||||
|
if ((currentTime - startTime) < 20) {
|
||||||
|
self.progress_bar_e.val((currentTime - startTime) / 20 * 100);
|
||||||
|
setTimeout(check, delay);
|
||||||
} else {
|
} else {
|
||||||
console.log('Failed to execute global chip erase');
|
console.log('Failed to execute global chip erase');
|
||||||
self.upload_procedure(99);
|
self.upload_procedure(99);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, delay);
|
};
|
||||||
|
setTimeout(check, delay);
|
||||||
} else {
|
} else {
|
||||||
console.log('Failed to initiate global chip erase');
|
console.log('Failed to initiate global chip erase');
|
||||||
self.upload_procedure(99);
|
self.upload_procedure(99);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue