1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 11:59:51 +03:00

clearStatus and loadAddress now return data

This commit is contained in:
cTn 2014-06-09 23:49:08 +02:00
parent e8fa4e1822
commit 7d3a29c0b7

View file

@ -184,7 +184,7 @@ STM32DFU_protocol.prototype.clearStatus = function(callback) {
function check_status() {
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function(data) {
if (data[4] == self.state.dfuIDLE) {
callback();
callback(data);
} else {
var delay = data[1] | (data[2] << 8) | (data[3] << 16);
@ -194,9 +194,7 @@ STM32DFU_protocol.prototype.clearStatus = function(callback) {
}
function clear_status() {
self.controlTransfer('out', self.request.CLRSTATUS, 0, 0, 0, 0, function() {
check_status();
});
self.controlTransfer('out', self.request.CLRSTATUS, 0, 0, 0, 0, check_status);
}
check_status();
@ -213,7 +211,7 @@ STM32DFU_protocol.prototype.loadAddress = function(address, callback) {
setTimeout(function() {
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function(data) {
if (data[4] == self.state.dfuDNLOAD_IDLE) {
callback();
callback(data);
} else {
console.log('Failed to execure address load');
self.upload_procedure(99);