1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 04:45:18 +03:00

Simplify and fix dataflash download

This commit is contained in:
Pawel Spychalski (DzikuVx) 2021-05-02 11:06:37 +02:00
parent 11a7ae743e
commit 81cb53c364
2 changed files with 29 additions and 61 deletions

View file

@ -2472,7 +2472,7 @@ var mspHelper = (function (gui) {
};
/**
* Send a request to read a block of data from the dataflash at the given address and pass that address and a dataview
* Send a request to read a block of data from the dataflash at the given address and pass that address and a ArrayBuffer
* of the returned data to the given callback (or null for the data if an error occured).
*/
self.dataflashRead = function (address, onDataCallback) {
@ -2496,7 +2496,7 @@ var mspHelper = (function (gui) {
/* Strip that address off the front of the reply and deliver it separately so the caller doesn't have to
* figure out the reply format:
*/
onDataCallback(address, new DataView(response.data.buffer, response.data.byteOffset + 4, response.data.buffer.byteLength - 4));
onDataCallback(address, response.data.buffer.slice(4));
} else {
// Report error
onDataCallback(address, null);