mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 21:35:33 +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) {
|
||||
if (data[4] == self.state.dfuDNBUSY) { // completely normal
|
||||
var delay = data[1] | (data[2] << 8) | (data[3] << 16);
|
||||
|
||||
setTimeout(function () {
|
||||
var startTime = (Date.now() / 1000 | 0);
|
||||
var check = function () {
|
||||
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function (data) {
|
||||
if (data[4] == self.state.dfuDNLOAD_IDLE) {
|
||||
self.progress_bar_e.val(100);
|
||||
self.upload_procedure(4);
|
||||
} else {
|
||||
console.log('Failed to execute global chip erase');
|
||||
self.upload_procedure(99);
|
||||
var currentTime = (Date.now() / 1000 | 0);
|
||||
if ((currentTime - startTime) < 20) {
|
||||
self.progress_bar_e.val((currentTime - startTime) / 20 * 100);
|
||||
setTimeout(check, delay);
|
||||
} else {
|
||||
console.log('Failed to execute global chip erase');
|
||||
self.upload_procedure(99);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, delay);
|
||||
};
|
||||
setTimeout(check, delay);
|
||||
} else {
|
||||
console.log('Failed to initiate global chip erase');
|
||||
self.upload_procedure(99);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue