1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 12:55:13 +03:00

Battery Status

This commit is contained in:
skaman82 2016-05-24 21:21:04 +02:00
parent cd35643a83
commit 60ef5a8cf9
16 changed files with 410 additions and 15 deletions

View file

@ -128,6 +128,9 @@ var MSP = {
ledDirectionLetters: ['n', 'e', 's', 'w', 'u', 'd'], // in LSB bit order
ledFunctionLetters: ['i', 'w', 'f', 'a', 't', 'r', 'c'], // in LSB bit order
last_received_timestamp: null,
analog_last_received_timestamp: null,
supportedBaudRates: [ // 0 based index.
'AUTO',
@ -235,6 +238,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)
@ -342,6 +346,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;