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

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
hydra committed May 12, 2016
2 parents 42d4846 + 0a3eec8 commit 4651724
Show file tree
Hide file tree
Showing 29 changed files with 564 additions and 69 deletions.
12 changes: 12 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,9 @@
"portsFunction_TELEMETRY_LTM": {
"message": "LTM"
},
"portsFunction_TELEMETRY_MAVLINK": {
"message": "MAVLink"
},
"portsFunction_TELEMETRY_MSP": {
"message": "MSP"
},
Expand Down Expand Up @@ -1620,5 +1623,14 @@
},
"failsafeKillSwitchHelp": {
"message": "Set this option to make the failsafe switch, configured in the modes tab, act as a direct kill switch, bypassing the selected failsafe procedure. <strong>Note:</strong> Arming is blocked with the failsafe kill switch in the ON position"
},
"mainHelpArmed": {
"message": "Motor Arming"
},
"mainHelpFailsafe": {
"message": "Failsafe Mode"
},
"mainHelpLink": {
"message": "Serial Link Status"
}
}
7 changes: 6 additions & 1 deletion changelog.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<span>2015.12.15 - 1.2.1 - cleanflight</span>
<span>2016.05.12 - 1.2.2 - cleanflight</span>
<ul>
<li>Better support for some USB VCP targets.</li>
<li>Support for MAVLink telemetry.</li>
</ul>
<span>2016.02.22 - 1.2.1 - cleanflight</span>
<ul>
<li>Add links to STM VCP Drivers and Zadig.</li>
<li>Update recovery procedure on Firmware Flasher page.</li>
Expand Down
16 changes: 16 additions & 0 deletions images/icons/cf_icon_armed_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions images/icons/cf_icon_armed_grey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions images/icons/cf_icon_bat_grey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions images/icons/cf_icon_failsafe_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions images/icons/cf_icon_failsafe_grey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions images/icons/cf_icon_link_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions images/icons/cf_icon_link_grey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions js/boards.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ var BOARD_DEFINITIONS = [
name: "SP Racing F3 Mini",
identifier: "SRFM",
vcp: true
}, {
name: "SP Racing F3 EVO",
identifier: "SPEV",
vcp: true
}, {
name: "Alienflight F3",
identifier: "AFF3",
vcp: true
}, {
name: "ImmersionRC Fusion F3",
identifier: "IFF3",
vcp: false
}, {
name: "MotoLab",
identifier: "MOTO",
Expand Down
2 changes: 1 addition & 1 deletion js/data_storage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var CONFIGURATOR = {
'releaseDate': 1456164608903, // new Date().getTime() - Mon Feb 22 2016 19:10:05 GMT+0100
'releaseDate': 1463055533515, // new Date().getTime() - Thu May 12 2016 14:19:06 GMT+0200

// all versions are specified and compared using semantic versioning http://semver.org/
'apiVersionAccepted': '1.2.1',
Expand Down
63 changes: 48 additions & 15 deletions js/msp.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ var MSP = {
unsupported: 0,

ledDirectionLetters: ['n', 'e', 's', 'w', 'u', 'd'], // in LSB bit order
ledFunctionLetters: ['i', 'w', 'f', 'a', 't', 'r', 'c'], // in LSB bit order
ledFunctionLetters: ['i', 'w', 'f', 'a', 't', 'r', 'c', 'g', 's', 'b'], // in LSB bit order

last_received_timestamp: null,
analog_last_received_timestamp: null,

supportedBaudRates: [ // 0 based index.
'AUTO',
'9600',
Expand All @@ -139,8 +142,18 @@ var MSP = {
'250000',
],

serialPortFunctions: // in LSB bit order
['MSP', 'GPS', 'TELEMETRY_FRSKY', 'TELEMETRY_HOTT', 'TELEMETRY_MSP', 'TELEMETRY_SMARTPORT', 'RX_SERIAL', 'BLACKBOX'],
serialPortFunctions: {
'MSP': 0,
'GPS': 1,
'TELEMETRY_FRSKY': 2,
'TELEMETRY_HOTT': 3,
'TELEMETRY_MSP': 4,
'TELEMETRY_LTM': 4, // LTM replaced MSP
'TELEMETRY_SMARTPORT': 5,
'RX_SERIAL': 6,
'BLACKBOX': 7,
'TELEMETRY_MAVLINK': 8,
},

read: function (readInfo) {
var data = new Uint8Array(readInfo.data);
Expand Down Expand Up @@ -224,6 +237,7 @@ var MSP = {
console.log('Unknown state detected: ' + this.state);
}
}
this.last_received_timestamp = Date.now();
},
process_data: function (code, message_buffer, message_length) {
var data = new DataView(message_buffer, 0); // DataView (allowing us to view arrayBuffer as struct/union)
Expand Down Expand Up @@ -321,6 +335,7 @@ var MSP = {
ANALOG.mAhdrawn = data.getUint16(1, 1);
ANALOG.rssi = data.getUint16(3, 1); // 0-1023
ANALOG.amperage = data.getInt16(5, 1) / 100; // A
this.analog_last_received_timestamp = Date.now();
break;
case MSP_codes.MSP_RC_TUNING:
var offset = 0;
Expand Down Expand Up @@ -420,8 +435,11 @@ var MSP = {
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
MISC.placeholder2 = data.getUint8(offset++);
if (semver.lt(CONFIG.apiVersion, "1.18.0"))
MISC.mag_declination = data.getInt16(offset, 1) / 10; // -1800-1800
else
MISC.mag_declination = data.getInt16(offset, 1) / 100; // -18000-18000
offset += 2;
MISC.vbatscale = data.getUint8(offset++, 1); // 10-200
MISC.vbatmincellvoltage = data.getUint8(offset++, 1) / 10; // 10-50
Expand All @@ -435,8 +453,11 @@ var MSP = {
_3D.deadband3d_high = data.getUint16(offset, 1);
offset += 2;
_3D.neutral3d = data.getUint16(offset, 1);
offset += 2;
_3D.deadband3d_throttle = data.getUint16(offset, 1);

if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
offset += 2;
_3D.deadband3d_throttle = data.getUint16(offset, 1);
}
break;
case MSP_codes.MSP_MOTOR_PINS:
console.log(data);
Expand Down Expand Up @@ -1220,8 +1241,13 @@ MSP.crunch = function (code) {
buffer.push(MISC.multiwiicurrentoutput);
buffer.push(MISC.rssi_channel);
buffer.push(MISC.placeholder2);
buffer.push(lowByte(Math.round(MISC.mag_declination * 10)));
buffer.push(highByte(Math.round(MISC.mag_declination * 10)));
if (semver.lt(CONFIG.apiVersion, "1.18.0")) {
buffer.push(lowByte(Math.round(MISC.mag_declination * 10)));
buffer.push(highByte(Math.round(MISC.mag_declination * 10)));
} else {
buffer.push(lowByte(Math.round(MISC.mag_declination * 100)));
buffer.push(highByte(Math.round(MISC.mag_declination * 100)));
}
buffer.push(MISC.vbatscale);
buffer.push(Math.round(MISC.vbatmincellvoltage * 10));
buffer.push(Math.round(MISC.vbatmaxcellvoltage * 10));
Expand Down Expand Up @@ -1321,8 +1347,10 @@ MSP.crunch = function (code) {
buffer.push(highByte(_3D.deadband3d_high));
buffer.push(lowByte(_3D.neutral3d));
buffer.push(highByte(_3D.neutral3d));
buffer.push(lowByte(_3D.deadband3d_throttle));
buffer.push(highByte(_3D.deadband3d_throttle));
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
buffer.push(lowByte(_3D.deadband3d_throttle));
buffer.push(highByte(_3D.deadband3d_throttle));
}
break;

case MSP_codes.MSP_SET_RC_DEADBAND:
Expand Down Expand Up @@ -1617,18 +1645,23 @@ MSP.sendLedStripConfig = function(onCompleteCallback) {
MSP.serialPortFunctionMaskToFunctions = function(functionMask) {
var functions = [];

for (var index = 0; index < MSP.serialPortFunctions.length; index++) {
if (bit_check(functionMask, index)) {
functions.push(MSP.serialPortFunctions[index]);
var keys = Object.keys(MSP.serialPortFunctions);
for (var index = 0; index < keys.length; index++) {
var key = keys[index];
var bit = MSP.serialPortFunctions[key];
if (bit_check(functionMask, bit)) {
functions.push(key);
}
}
return functions;
}

MSP.serialPortFunctionsToMask = function(functions) {
var mask = 0;
var keys = Object.keys(MSP.serialPortFunctions);
for (var index = 0; index < functions.length; index++) {
var bitIndex = MSP.serialPortFunctions.indexOf(functions[index]);
var key = functions[index];
var bitIndex = MSP.serialPortFunctions[key];
if (bitIndex >= 0) {
mask = bit_set(mask, bitIndex);
}
Expand Down
6 changes: 5 additions & 1 deletion js/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ var serial = {
break;

case 'device_lost':
// TODO
if (GUI.connected_to || GUI.connecting_to) {
$('a.connect').click();
} else {
self.disconnect();
}
break;

case 'disconnected':
Expand Down
Loading

0 comments on commit 4651724

Please sign in to comment.