1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

rssi_aux_channel support in receiver tab, hybrid box bugfixes

This commit is contained in:
cTn 2014-09-24 16:01:23 +02:00
parent 4719d1562d
commit fe4240deb7
5 changed files with 62 additions and 8 deletions

View file

@ -446,6 +446,9 @@
"receiverChannelMap": { "receiverChannelMap": {
"message": "Channel Map" "message": "Channel Map"
}, },
"receiverRssiAux": {
"message": "RSSI on AUX"
},
"receiverRefreshRateTitle": { "receiverRefreshRateTitle": {
"message": "Graph refresh rate" "message": "Graph refresh rate"
}, },

View file

@ -444,7 +444,7 @@ var MSP = {
} }
break; break;
case MSP_codes.MSP_SET_RCMAP: case MSP_codes.MSP_SET_RCMAP:
console.log('RCMAP Updated'); console.log('RCMAP saved');
break; break;
case MSP_codes.MSP_CONFIG: case MSP_codes.MSP_CONFIG:
BF_CONFIG.mixerConfiguration = data.getUint8(0); BF_CONFIG.mixerConfiguration = data.getUint8(0);

View file

@ -126,14 +126,40 @@
line-height: 20px; line-height: 20px;
text-align: right; text-align: right;
} }
.tab-receiver .rssi_aux_wrapper {
float: right;
margin: 10px 0 0 0;
width: 126px;
border: 1px solid #8b8b8b;
border-left: 0;
}
.tab-receiver .rssi_aux_wrapper .head {
height: 15px;
padding: 4px;
text-align: center;
font-weight: bold;
border-bottom: 1px solid #8b8b8b;
background-color: #ececec;
}
.tab-receiver .rssi_aux_wrapper select {
width: 100%;
height: 22px;
padding-left: 5px;
}
.tab-receiver .rcmap_wrapper { .tab-receiver .rcmap_wrapper {
float: right; float: right;
position: relative; position: relative;
width: 126px;
margin: 10px 0 0 0; margin: 10px 0 0 0;
width: 126px;
border: 1px solid #8b8b8b; border: 1px solid #8b8b8b;
} }
.tab-receiver .rcmap_wrapper .head { .tab-receiver .rcmap_wrapper .head {

View file

@ -22,6 +22,16 @@
<td><input type="number" name="expo" step="0.01" min="0" max="1" /></td> <td><input type="number" name="expo" step="0.01" min="0" max="1" /></td>
</tr> </tr>
</table> </table>
<div class="rssi_aux_wrapper">
<div class="head" i18n="receiverRssiAux"></div>
<select name="rssi_aux_channel">
<option value="0">Disabled</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<div class="rcmap_wrapper"> <div class="rcmap_wrapper">
<div class="head" i18n="receiverChannelMap"></div> <div class="head" i18n="receiverChannelMap"></div>
<div class="hybrid_element"> <div class="hybrid_element">

View file

@ -6,6 +6,11 @@ TABS.receiver.initialize = function (callback) {
GUI.active_tab = 'receiver'; GUI.active_tab = 'receiver';
googleAnalytics.sendAppView('Receiver Page'); googleAnalytics.sendAppView('Receiver Page');
function get_misc_data() {
MSP.send_message(MSP_codes.MSP_MISC, false, false, get_rc_data);
}
function get_rc_data() { function get_rc_data() {
MSP.send_message(MSP_codes.MSP_RC, false, false, get_rc_map); MSP.send_message(MSP_codes.MSP_RC, false, false, get_rc_map);
} }
@ -23,7 +28,7 @@ TABS.receiver.initialize = function (callback) {
$('#content').load("./tabs/receiver.html", process_html); $('#content').load("./tabs/receiver.html", process_html);
} }
MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_rc_data); MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_misc_data);
function process_html() { function process_html() {
// translate to user-selected language // translate to user-selected language
@ -99,7 +104,7 @@ TABS.receiver.initialize = function (callback) {
} }
}).resize(); // trigger so labels get correctly aligned on creation }).resize(); // trigger so labels get correctly aligned on creation
// handle rcmap // handle rcmap & rssi aux channel
if (bit_check(CONFIG.capability, 30)) { if (bit_check(CONFIG.capability, 30)) {
var RC_MAP_Letters = ['A', 'E', 'R', 'T', '1', '2', '3', '4']; var RC_MAP_Letters = ['A', 'E', 'R', 'T', '1', '2', '3', '4'];
@ -154,12 +159,15 @@ TABS.receiver.initialize = function (callback) {
}); });
// handle helper // handle helper
// TODO fix this $('select[name="rcmap_helper"]').val(0); // go out of bounds
$('select[name="rcmap_helper"]').change(function () { $('select[name="rcmap_helper"]').change(function () {
$('input[name="rcmap"]').val($(this).val()); $('input[name="rcmap"]').val($(this).val());
}); });
// rssi aux
$('select[name="rssi_aux_channel"]').val(MISC.rssi_aux_channel);
} else { } else {
$('.rcmap_wrapper').hide(); $('.rcmap_wrapper, .rssi_aux_wrapper').hide();
} }
// UI Hooks // UI Hooks
@ -268,8 +276,15 @@ TABS.receiver.initialize = function (callback) {
RC_MAP[i] = strBuffer.indexOf(RC_MAP_Letters[i]); RC_MAP[i] = strBuffer.indexOf(RC_MAP_Letters[i]);
} }
// catch rssi aux
MISC.rssi_aux_channel = parseInt($('select[name="rssi_aux_channel"]').val());
function save_rc_map() { function save_rc_map() {
MSP.send_message(MSP_codes.MSP_SET_RCMAP, MSP.crunch(MSP_codes.MSP_SET_RCMAP), false, save_to_eeprom); MSP.send_message(MSP_codes.MSP_SET_RCMAP, MSP.crunch(MSP_codes.MSP_SET_RCMAP), false, save_misc);
}
function save_misc() {
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_to_eeprom);
} }
function save_to_eeprom() { function save_to_eeprom() {