Merge branch 'development' of git://github.com/tricopterY/cleanflight-configurator into tricopterY-development

Conflicts:
	tabs/pid_tuning.html
10.3.x-maintenance
Dominic Clifton 2015-03-29 12:01:42 +01:00
commit 99494d0157
8 changed files with 166 additions and 33 deletions

View File

@ -451,6 +451,12 @@
"configurationMagDeclination": {
"message": "Magnetometer Declination [deg]"
},
"configurationAutoDisarmDelay": {
"message": "Disarm motors after set delay(Seconds)- Only if feature MOTOR_STOP enabled"
},
"configurationDisarmKillSwitch": {
"message": "Disarm motors regardless of throttle value - Only when arming and disarming via AUX channel"
},
"configurationThrottleMinimum": {
"message": "Minimum Throttle"
},

View File

@ -1,5 +1,6 @@
<span>2015.03.11 - 0.63.0 - cleanflight</span>
<span>2015.03.14 - 0.63.0 - cleanflight</span>
<p>
- Configuration tab supports auto_disarm_delay and disarm_kill_switch - Requires 1.8.0 firmware.<br />
- PID Tuning tab allows TPA Breakpoint changes - Requires 1.8.0 firmware.<br />
- Corrected Artificial Horizon Pitch/Roll views.<br />
- Changed logging time stamp to include date stamp.<br />

View File

@ -136,6 +136,13 @@ var ANALOG = {
amperage: 0
};
var ARMING_CONFIG = {
auto_disarm_delay: 0,
disarm_kill_switch: 0
};
var LOOP_TIME = 0;
var MISC = {
midrc: 0,
minthrottle: 0,

View File

@ -22,6 +22,10 @@ var MSP_codes = {
MSP_SONAR: 58,
MSP_PID_CONTROLLER: 59,
MSP_SET_PID_CONTROLLER: 60,
MSP_ARMING_CONFIG: 61,
MSP_SET_ARMING_CONFIG: 62,
MSP_LOOP_TIME: 63,
MSP_SET_LOOP_TIME: 64,
MSP_DATAFLASH_SUMMARY: 70,
MSP_DATAFLASH_READ: 71,
MSP_DATAFLASH_ERASE: 72,
@ -48,7 +52,7 @@ var MSP_codes = {
MSP_WP: 118,
MSP_BOXIDS: 119,
MSP_SERVO_CONF: 120,
MSP_SET_RAW_RC: 200,
MSP_SET_RAW_GPS: 201,
MSP_SET_PID: 202,
@ -63,7 +67,7 @@ var MSP_codes = {
MSP_SET_HEAD: 211,
MSP_SET_SERVO_CONF: 212,
MSP_SET_MOTOR: 214,
// MSP_BIND: 240,
MSP_EEPROM_WRITE: 250,
@ -348,23 +352,41 @@ var MSP = {
}
break;
*/
case MSP_codes.MSP_ARMING_CONFIG:
if (CONFIG.apiVersion >= 1.8) {
ARMING_CONFIG.auto_disarm_delay = data.getUint8(0, 1);
ARMING_CONFIG.disarm_kill_switch = data.getUint8(1);
}
break;
case MSP_codes.MSP_LOOP_TIME:
if (CONFIG.apiVersion >= 1.8) {
LOOP_TIME = data.getInt16(0, 1);
}
break;
case MSP_codes.MSP_MISC: // 22 bytes
MISC.midrc = data.getInt16(0, 1);
MISC.minthrottle = data.getUint16(2, 1); // 0-2000
MISC.maxthrottle = data.getUint16(4, 1); // 0-2000
MISC.mincommand = data.getUint16(6, 1); // 0-2000
MISC.failsafe_throttle = data.getUint16(8, 1); // 1000-2000
MISC.gps_type = data.getUint8(10);
MISC.gps_baudrate = data.getUint8(11);
MISC.gps_ubx_sbas = data.getInt8(12);
MISC.multiwiicurrentoutput = data.getUint8(13);
MISC.rssi_channel = data.getUint8(14);
MISC.placeholder2 = data.getUint8(15);
MISC.mag_declination = data.getInt16(16, 1) / 10; // -18000-18000
MISC.vbatscale = data.getUint8(18, 1); // 10-200
MISC.vbatmincellvoltage = data.getUint8(19, 1) / 10; // 10-50
MISC.vbatmaxcellvoltage = data.getUint8(20, 1) / 10; // 10-50
MISC.vbatwarningcellvoltage = data.getUint8(21, 1) / 10; // 10-50
var offset = 0;
MISC.midrc = data.getInt16(offset, 1);
offset += 2;
MISC.minthrottle = data.getUint16(offset, 1); // 0-2000
offset += 2;
MISC.maxthrottle = data.getUint16(offset, 1); // 0-2000
offset += 2;
MISC.mincommand = data.getUint16(offset, 1); // 0-2000
offset += 2;
MISC.failsafe_throttle = data.getUint16(offset, 1); // 1000-2000
offset += 2;
MISC.gps_type = data.getUint8(offset);
MISC.gps_baudrate = data.getUint8(++offset);
MISC.gps_ubx_sbas = data.getInt8(++offset);
MISC.multiwiicurrentoutput = data.getUint8(++offset);
MISC.rssi_channel = data.getUint8(++offset);
MISC.placeholder2 = data.getUint8(++offset);
MISC.mag_declination = data.getInt16(++offset, 1) / 10; // -18000-18000
offset += 2;
MISC.vbatscale = data.getUint8(offset, 1); // 10-200
MISC.vbatmincellvoltage = data.getUint8(++offset, 1) / 10; // 10-50
MISC.vbatmaxcellvoltage = data.getUint8(++offset, 1) / 10; // 10-50
MISC.vbatwarningcellvoltage = data.getUint8(++offset, 1) / 10; // 10-50
break;
case MSP_codes.MSP_MOTOR_PINS:
console.log(data);
@ -958,6 +980,18 @@ MSP.crunch = function (code) {
buffer.push(lowByte(CONFIG.accelerometerTrims[1]));
buffer.push(highByte(CONFIG.accelerometerTrims[1]));
break;
case MSP_codes.MSP_SET_ARMING_CONFIG:
if (CONFIG.apiVersion >= 1.8) {
buffer.push(ARMING_CONFIG.auto_disarm_delay);
buffer.push(ARMING_CONFIG.disarm_kill_switch);
}
break;
case MSP_codes.MSP_SET_LOOP_TIME:
if (CONFIG.apiVersion >= 1.8) {
buffer.push(lowByte(LOOP_TIME));
buffer.push(highByte(LOOP_TIME));
}
break;
case MSP_codes.MSP_SET_MISC:
buffer.push(lowByte(MISC.midrc));
buffer.push(highByte(MISC.midrc));

View File

@ -139,6 +139,21 @@
.tab-configuration .current .checkbox span {
margin-left: 15px;
}
.tab-configuration .disarm .checkbox {
margin-top: 2px;
}
.tab-configuration .disarm .checkbox div {
float: left;
width: 60px;
margin-bottom: 5px;
}
.tab-configuration .disarm .checkbox div input {
display: block;
margin: 2px auto 0 auto;
}
.tab-configuration .disarm .checkbox span {
margin-left: 15px;
}
.tab-configuration .save {
display: block;

View File

@ -26,6 +26,24 @@
<!-- table generated here -->
</tbody>
</table>
<!-- -->
<div class="disarm">
<div class="number disarmdelay" style="display: none;">
<label>
<input type="number" name="autodisarmdelay" min="0" max="60" />
<span i18n="configurationAutoDisarmDelay"></span>
</label>
</div>
<div class="checkbox">
<label>
<div>
<input type="checkbox" name="disarmkillswitch" />
</div>
<span i18n="configurationDisarmKillSwitch"></span>
</label>
</div>
</div>
<!-- -->
<div class="number">
<label>
<input type="number" name="minthrottle" min="0" max="2000" />
@ -277,4 +295,4 @@
<div class="buttons">
<a class="save" href="#" i18n="configurationButtonSave"></a>
</div>
</div>
</div>

View File

@ -31,7 +31,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
function load_acc_trim() {
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_html);
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false
, CONFIG.apiVersion >= 1.8 ? load_arming_config : load_html);
}
function load_arming_config() {
MSP.send_message(MSP_codes.MSP_ARMING_CONFIG, false, false, load_html);
}
function load_html() {
@ -90,14 +95,41 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
for (var i = 0; i < features.length; i++) {
var row_e;
if (features[i].mode == 'group') {
row_e = $('<tr><td><input class="feature" id="feature-' + i + '" value="' + features[i].bit + '" title="' + features[i].name + '" type="radio" name="' + features[i].group + '" /></td><td><label for="feature-' + i + '">' + features[i].name + '</label></td><td>' + features[i].description + '</td>');
if (features[i].mode === 'group') {
row_e = $('<tr><td><input class="feature" id="feature-'
+ i
+ '" value="'
+ features[i].bit
+ '" title="'
+ features[i].name
+ '" type="radio" name="'
+ features[i].group
+ '" /></td><td><label for="feature-'
+ i
+ '">'
+ features[i].name
+ '</label></td><td>'
+ features[i].description
+ '</td>');
radioGroups.push(features[i].group);
} else {
row_e = $('<tr><td><input class="feature" id="feature-' + i + '" title="' + features[i].name + '" type="checkbox" /></td><td><label for="feature-' + i + '">' + features[i].name + '</label></td><td>' + features[i].description + '</td>');
var feature_e = row_e.find('input.feature');
feature_e.data('bit', features[i].bit);
var feature_e = row_e.find('input.feature');
row_e = $('<tr><td><input class="feature" id="feature-'
+ i
+ '" name="'
+ features[i].name
+ '" title="'
+ features[i].name
+ '" type="checkbox" /></td><td><label for="feature-'
+ i
+ '">'
+ features[i].name
+ '</label></td><td>'
+ features[i].description
+ '</td>');
feature_e.prop('checked', bit_check(BF_CONFIG.features, features[i].bit));
feature_e.data('bit', features[i].bit);
}
features_e.each(function () {
@ -223,6 +255,16 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
// fill magnetometer
$('input[name="mag_declination"]').val(MISC.mag_declination);
//fill motor disarm params
if(CONFIG.apiVersion >= 1.8) {
$('input[name="autodisarmdelay"]').val(ARMING_CONFIG.auto_disarm_delay);
$('input[name="disarmkillswitch"]').prop('checked', ARMING_CONFIG.disarm_kill_switch);
if(bit_check(BF_CONFIG.features, 4 + 1))//MOTOR_STOP
$('div.disarmdelay').slideDown();
}
else
$('div.disarm').hide();
// fill throttle
$('input[name="minthrottle"]').val(MISC.minthrottle);
$('input[name="midthrottle"]').val(MISC.midrc);
@ -250,8 +292,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
if (state) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, index);
if(element.attr('name') === 'MOTOR_STOP')
$('div.disarmdelay').slideDown();
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, index);
if(element.attr('name') === 'MOTOR_STOP')
$('div.disarmdelay').slideUp();
}
});
@ -285,7 +331,13 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
CONFIG.accelerometerTrims[1] = parseInt($('input[name="roll"]').val());
CONFIG.accelerometerTrims[0] = parseInt($('input[name="pitch"]').val());
MISC.mag_declination = parseFloat($('input[name="mag_declination"]').val());
// motor disarm
if(CONFIG.apiVersion >= 1.8) {
ARMING_CONFIG.auto_disarm_delay = parseInt($('input[name="autodisarmdelay"]').val());
ARMING_CONFIG.disarm_kill_switch = ~~$('input[name="disarmkillswitch"]').is(':checked'); // ~~ boolean to decimal conversion
}
MISC.minthrottle = parseInt($('input[name="minthrottle"]').val());
MISC.midrc = parseInt($('input[name="midthrottle"]').val());
MISC.maxthrottle = parseInt($('input[name="maxthrottle"]').val());
@ -314,7 +366,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
function save_acc_trim() {
MSP.send_message(MSP_codes.MSP_SET_ACC_TRIM, MSP.crunch(MSP_codes.MSP_SET_ACC_TRIM), false, save_to_eeprom);
MSP.send_message(MSP_codes.MSP_SET_ACC_TRIM, MSP.crunch(MSP_codes.MSP_SET_ACC_TRIM), false
, CONFIG.apiVersion >= 1.8 ? save_arming_config : save_to_eeprom);
}
function save_arming_config() {
MSP.send_message(MSP_codes.MSP_SET_ARMING_CONFIG, MSP.crunch(MSP_codes.MSP_SET_ARMING_CONFIG), false, save_to_eeprom);
}
function save_to_eeprom() {

View File

@ -90,11 +90,6 @@
float: right;
width: calc(40% - 10px); /* - ( "virtual" margin) */
}
.tab-pid_tuning .rate-tpa .tpa{
float: right;
border: 1px solid #ADDFAC; /*THEME CHANGE HERE*/
width: calc(100% - 10px); /* - ( "virtual" margin) */
}
.tab-pid_tuning .buttons {
width: calc(100% - 20px);