Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Merge commit '34e8c55a006ed3a2a989bf4e57c32bfa2e56f35b' into development
Browse files Browse the repository at this point in the history
Conflicts:
	js/msp.js
  • Loading branch information
hydra committed May 25, 2015
2 parents b1f06ac + 34e8c55 commit 774fcf5
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 3 deletions.
3 changes: 3 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@
},
"receiverRcExpo": {
"message": "RC Expo"
},
"receiverRcYawExpo": {
"message": "RC Yaw Expo"
},
"receiverChannelMap": {
"message": "Channel Map"
Expand Down
3 changes: 2 additions & 1 deletion js/data_storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ var RC_tuning = {
dynamic_THR_PID: 0,
throttle_MID: 0,
throttle_EXPO: 0,
dynamic_THR_breakpoint: 0
dynamic_THR_breakpoint: 0,
RC_YAW_EXPO: 0
};

var AUX_CONFIG = [];
Expand Down
11 changes: 10 additions & 1 deletion js/msp.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,16 @@ var MSP = {
RC_tuning.throttle_MID = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
RC_tuning.throttle_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
if (semver.gte(CONFIG.apiVersion, "1.7.0")) {
RC_tuning.dynamic_THR_breakpoint = data.getUint16(offset++, 1);
RC_tuning.dynamic_THR_breakpoint = data.getUint16(offset, 1);
offset += 2;
} else {
RC_tuning.dynamic_THR_breakpoint = 0;
}
if (semver.gte(CONFIG.apiVersion, "1.10.0")) {
RC_tuning.RC_YAW_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
} else {
RC_tuning.RC_YAW_EXPO = 0;
}
break;
case MSP_codes.MSP_PID:
// PID data arrived, we need to scale it and save to appropriate bank / array
Expand Down Expand Up @@ -970,6 +976,9 @@ MSP.crunch = function (code) {
if (semver.gte(CONFIG.apiVersion, "1.7.0")) {
buffer.push(lowByte(RC_tuning.dynamic_THR_breakpoint));
buffer.push(highByte(RC_tuning.dynamic_THR_breakpoint));
}
if (semver.gte(CONFIG.apiVersion, "1.10.0")) {
buffer.push(parseInt(RC_tuning.RC_YAW_EXPO * 100));
}
break;
// Disabled, cleanflight does not use MSP_SET_BOX.
Expand Down
7 changes: 7 additions & 0 deletions tabs/receiver.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@
.tab-receiver .tunings .throttle {
margin-bottom: 10px;
}
.tab-receiver .tunings .rate {
margin-bottom: 10px;
}
.tab-receiver .tunings .yaw_rate {
margin-left: 127px;
margin-bottom: 10px;
}
.tab-receiver .tunings table, .tab-receiver .tunings table th, .tab-receiver .tunings table td {
padding: 4px;
border: 1px solid #8b8b8b;
Expand Down
8 changes: 8 additions & 0 deletions tabs/receiver.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
<td><input type="number" name="expo" step="0.01" min="0" max="1" /></td>
</tr>
</table>
<table class="yaw_rate">
<tr>
<th i18n="receiverRcYawExpo"></th>
</tr>
<tr>
<td><input type="number" name="yaw_expo" step="0.01" min="0" max="1" /></td>
</tr>
</table>
<div class="rssi_channel_wrapper">
<div class="head" i18n="receiverRssiChannel"></div>
<select name="rssi_channel">
Expand Down
8 changes: 7 additions & 1 deletion tabs/receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ TABS.receiver.initialize = function (callback) {

$('.tunings .rate input[name="rate"]').val(RC_tuning.RC_RATE.toFixed(2));
$('.tunings .rate input[name="expo"]').val(RC_tuning.RC_EXPO.toFixed(2));

$('.tunings .yaw_rate input[name="yaw_expo"]').val(RC_tuning.RC_YAW_EXPO.toFixed(2));

if (semver.lt(CONFIG.apiVersion, "1.10.0")) {
$('.tunings .yaw_rate input[name="yaw_expo"]').hide();
}

chrome.storage.local.get('rx_refresh_rate', function (result) {
if (result.rx_refresh_rate) {
$('select[name="rx_refresh_rate"]').val(result.rx_refresh_rate).change();
Expand Down Expand Up @@ -268,6 +273,7 @@ TABS.receiver.initialize = function (callback) {

RC_tuning.RC_RATE = parseFloat($('.tunings .rate input[name="rate"]').val());
RC_tuning.RC_EXPO = parseFloat($('.tunings .rate input[name="expo"]').val());
RC_tuning.RC_YAW_EXPO = parseFloat($('.tunings .yaw_rate input[name="yaw_expo"]').val());

// catch rc map
var RC_MAP_Letters = ['A', 'E', 'R', 'T', '1', '2', '3', '4'];
Expand Down

0 comments on commit 774fcf5

Please sign in to comment.