diff --git a/js/boards.js b/js/boards.js index 6f0b6bd2..5b3850f3 100644 --- a/js/boards.js +++ b/js/boards.js @@ -31,6 +31,9 @@ var BOARD_DEFINITIONS = [ }, { name: "STM32F3Discovery", identifier: "SDF3" + }, { + name: "Colibri Race", + identifier: "CLBR" }, { name: "SP Racing F3", identifier: "SRF3" diff --git a/tabs/configuration.js b/tabs/configuration.js old mode 100644 new mode 100755 index 962f5120..53803d76 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -45,6 +45,16 @@ TABS.configuration.initialize = function (callback, scrollPosition) { MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_config); + function waitSeconds(iMilliSeconds) { + var counter= 0 + , start = new Date().getTime() + , end = 0; + while (counter < iMilliSeconds) { + end = new Date().getTime(); + counter = end - start; + } + } + function process_html() { // translate to user-selected language localize(); @@ -400,6 +410,15 @@ TABS.configuration.initialize = function (callback, scrollPosition) { } MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_serial_config); + + if(CONFIG.boardIdentifier == "CLBR") { + waitSeconds(200); + $('a.connect').click(); + + waitSeconds(500); + $('a.connect').click(); + } + }); // status data pulled via separate timer with static speed diff --git a/tabs/ports.js b/tabs/ports.js old mode 100644 new mode 100755 index 055d8075..9073a88a --- a/tabs/ports.js +++ b/tabs/ports.js @@ -211,6 +211,16 @@ TABS.ports.initialize = function (callback, scrollPosition) { if (callback) callback(); } + function waitSeconds(iMilliSeconds) { + var counter= 0 + , start = new Date().getTime() + , end = 0; + while (counter < iMilliSeconds) { + end = new Date().getTime(); + counter = end - start; + } + } + function on_save_handler() { // update configuration based on current ui state @@ -271,6 +281,15 @@ TABS.ports.initialize = function (callback, scrollPosition) { }); }, rebootTimeoutDelay); } + + if(CONFIG.boardIdentifier == "CLBR") { + waitSeconds(200); + $('a.connect').click(); + + waitSeconds(500); + $('a.connect').click(); + } + } };