Permalink
Browse files

Support FC and OSD boards.

  • Loading branch information...
1 parent 5a330f9 commit e8c8a846861348810dab4eca43e50fa12774ca2f @hydra hydra committed Sep 13, 2016
Showing with 14 additions and 6 deletions.
  1. +6 −0 js/gui.js
  2. +1 −1 js/msp.js
  3. +1 −0 js/serial_backend.js
  4. +3 −3 main.html
  5. +3 −2 main.js
View
@@ -259,6 +259,12 @@ GUI_control.prototype.updateTabsConnected = function() {
found = true;
}
});
+
+ if (CONFIG.boardType == 0) {
+ if (classes.indexOf("osd-required") >= 0) {
+ found = false;
+ }
+ }
return found;
}).show();
View
@@ -787,7 +787,7 @@ var MSP = {
CONFIG.boardIdentifier = identifier;
CONFIG.boardVersion = data.getUint16(offset, 1);
offset+=2;
- if (data.byteLength > offset) {
+ if (semver.gte(CONFIG.apiVersion, "1.22.0")) {
CONFIG.boardType = data.getUint8(offset, 1);
offset++;
} else {
@@ -214,6 +214,7 @@ function onOpen(openInfo) {
switch (CONFIG.boardType) {
case 0:
+ case 2:
GUI.allowedTabs = GUI.defaultAllowedFCTabsWhenConnected.slice();
if (semver.lt(CONFIG.apiVersion, "1.4.0")) {
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('led_strip'), 1);
View
@@ -215,11 +215,11 @@
</ul>
<ul class="mode-connected">
<li class="tab_setup"><a href="#" i18n="tabSetup" class="tabicon ic_setup" title="Setup"></a></li>
- <li class="tab_setup_osd"><a href="#" i18n="tabSetupOSD" class="tabicon ic_setup" title="OSD Setup"></a></li>
- <li class="tab_osd_configuration"><a href="#" i18n="tabOSDConfiguration" class="tabicon ic_setup" title="OSD Configuration"></a></li>
+ <li class="tab_setup_osd osd-required"><a href="#" i18n="tabSetupOSD" class="tabicon ic_setup" title="OSD Setup"></a></li>
+ <li class="tab_osd_configuration osd-required"><a href="#" i18n="tabOSDConfiguration" class="tabicon ic_setup" title="OSD Configuration"></a></li>
+ <li class="tab_osd_layout osd-required"><a href="#" i18n="tabOSDLayout" class="tabicon ic_osd" title="OSD Layout"></a></li>
<li class="tab_ports"><a href="#" i18n="tabPorts" class="tabicon ic_ports" title="Ports"></a></li>
<li class="tab_configuration"><a href="#" i18n="tabConfiguration" class="tabicon ic_config" title="Configuration"></a></li>
- <li class="tab_osd_layout"><a href="#" i18n="tabOSDLayout" class="tabicon ic_osd" title="OSD Layout"></a></li>
<li class="tab_failsafe"><a href="#" i18n="tabFailsafe" class="tabicon ic_failsafe" title="Failsafe"></a></li>
<li class="tab_pid_tuning"><a href="#" i18n="tabPidTuning" class="tabicon ic_pid" title="PID Tuning"></a></li>
<li class="tab_receiver"><a href="#" i18n="tabReceiver" class="tabicon ic_rx" title="Receiver"></a></li>
View
@@ -59,8 +59,9 @@ $(document).ready(function () {
var ui_tabs = $('#tabs > ul');
$('a', ui_tabs).click(function () {
if ($(this).parent().hasClass('active') == false && !GUI.tab_switch_in_progress) { // only initialize when the tab isn't already active
- var self = this,
- tabClass = $(self).parent().prop('class');
+ var self = this;
+ var tabClasses = $(self).parent().prop('class');
+ var tabClass = tabClasses.split(" ")[0];
var tabRequiresConnection = $(self).parent().hasClass('mode-connected');

0 comments on commit e8c8a84

Please sign in to comment.