mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 17:25:16 +03:00
Fix and make bigger max size local file to flash (#1520)
Fix and make bigger max size local file to flash
This commit is contained in:
commit
9a90f5377d
1 changed files with 3 additions and 9 deletions
|
@ -379,17 +379,11 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, file.name);
|
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, file.name);
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
|
|
||||||
reader.onprogress = function (e) {
|
|
||||||
if (e.total > 1048576) { // 1 MB
|
|
||||||
// dont allow reading files bigger then 1 MB
|
|
||||||
console.log('File limit (1 MB) exceeded, aborting');
|
|
||||||
reader.abort();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
reader.onloadend = function(e) {
|
reader.onloadend = function(e) {
|
||||||
|
|
||||||
if (e.total != 0 && e.total == e.loaded) {
|
if (e.total != 0 && e.total == e.loaded) {
|
||||||
console.log('File loaded');
|
|
||||||
|
console.log('File loaded (' + e.loaded + ')');
|
||||||
|
|
||||||
intel_hex = e.target.result;
|
intel_hex = e.target.result;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue