1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +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:
Michael Keller 2019-07-05 07:51:54 +12:00 committed by GitHub
commit 9a90f5377d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -379,17 +379,11 @@ TABS.firmware_flasher.initialize = function (callback) {
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, file.name);
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) {
if (e.total != 0 && e.total == e.loaded) {
console.log('File loaded');
console.log('File loaded (' + e.loaded + ')');
intel_hex = e.target.result;