Merge commit '8e7097c' into development

pull/3/head
Dominic Clifton 9 years ago
commit 5c85ba7011

@ -3,43 +3,58 @@
var BOARD_DEFINITIONS = [ var BOARD_DEFINITIONS = [
{ {
name: "CC3D", name: "CC3D",
identifier: "CC3D" identifier: "CC3D",
vcp: true
}, { }, {
name: "ChebuzzF3", name: "ChebuzzF3",
identifier: "CHF3" identifier: "CHF3",
vcp: false
}, { }, {
name: "CJMCU", name: "CJMCU",
identifier: "CJM1" identifier: "CJM1",
vcp: false
}, { }, {
name: "EUSTM32F103RB", name: "EUSTM32F103RB",
identifier: "EUF1" identifier: "EUF1",
vcp: false
}, { }, {
name: "Naze/Flip32+", name: "Naze/Flip32+",
identifier: "AFNA" identifier: "AFNA",
vcp: false
}, { }, {
name: "Naze32Pro", name: "Naze32Pro",
identifier: "AFF3" identifier: "AFF3",
vcp: false
}, { }, {
name: "Olimexino", name: "Olimexino",
identifier: "OLI1" identifier: "OLI1"
}, { }, {
name: "Port103R", name: "Port103R",
identifier: "103R" identifier: "103R",
vcp: false
}, { }, {
name: "Sparky", name: "Sparky",
identifier: "SPKY" identifier: "SPKY",
vcp: true
}, { }, {
name: "STM32F3Discovery", name: "STM32F3Discovery",
identifier: "SDF3" identifier: "SDF3",
vcp: true
}, {
name: "Colibri Race",
identifier: "CLBR",
vcp: true
}, { }, {
name: "SP Racing F3", name: "SP Racing F3",
identifier: "SRF3" identifier: "SRF3",
vcp: false
} }
]; ];
var DEFAULT_BOARD_DEFINITION = { var DEFAULT_BOARD_DEFINITION = {
name: "Unknown", name: "Unknown",
identifier: "????" identifier: "????",
vcp: false
}; };
var BOARD = { var BOARD = {

@ -428,12 +428,20 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
function reinitialize() { function reinitialize() {
GUI.log(chrome.i18n.getMessage('deviceRebooting')); GUI.log(chrome.i18n.getMessage('deviceRebooting'));
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() { if (BOARD.find_board_definition(CONFIG.boardIdentifier).vcp) { // VCP-based flight controls may crash old drivers, we catch and reconnect
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () { $('a.connect').click();
GUI.log(chrome.i18n.getMessage('deviceReady')); GUI.timeout_add('start_connection',function start_connection() {
TABS.configuration.initialize(false, $('#content').scrollTop()); $('a.connect').click();
}); },2000);
},1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts } else {
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceReady'));
TABS.configuration.initialize(false, $('#content').scrollTop());
});
},1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
}
} }
MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_serial_config); MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_serial_config);

@ -239,12 +239,9 @@ TABS.ports.initialize = function (callback, scrollPosition) {
blackbox_baudrate: $(portConfiguration_e).find('.blackbox_baudrate').val(), blackbox_baudrate: $(portConfiguration_e).find('.blackbox_baudrate').val(),
identifier: oldSerialPort.identifier identifier: oldSerialPort.identifier
}; };
console.log(serialPort);
SERIAL_CONFIG.ports.push(serialPort); SERIAL_CONFIG.ports.push(serialPort);
}); });
MSP.send_message(MSP_codes.MSP_SET_CF_SERIAL_CONFIG, MSP.crunch(MSP_codes.MSP_SET_CF_SERIAL_CONFIG), false, save_to_eeprom); MSP.send_message(MSP_codes.MSP_SET_CF_SERIAL_CONFIG, MSP.crunch(MSP_codes.MSP_SET_CF_SERIAL_CONFIG), false, save_to_eeprom);
function save_to_eeprom() { function save_to_eeprom() {
@ -262,14 +259,22 @@ TABS.ports.initialize = function (callback, scrollPosition) {
function on_reboot_success_handler() { function on_reboot_success_handler() {
GUI.log(chrome.i18n.getMessage('deviceRebooting')); GUI.log(chrome.i18n.getMessage('deviceRebooting'));
var rebootTimeoutDelay = 1500; // seems to be just the right amount of delay to prevent data request timeouts if (BOARD.find_board_definition(CONFIG.boardIdentifier).vcp) { // VCP-based flight controls may crash old drivers, we catch and reconnect
$('a.connect').click();
GUI.timeout_add('start_connection',function start_connection() {
$('a.connect').click();
},2000);
} else {
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceReady'));
TABS.ports.initialize(false, $('#content').scrollTop());
});
}, 1500); // seems to be just the right amount of delay to prevent data request timeouts
}
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceReady'));
TABS.ports.initialize(false, $('#content').scrollTop());
});
}, rebootTimeoutDelay);
} }
} }
}; };

Loading…
Cancel
Save